[PATCH] completion: complete "git diff ...branc<TAB>"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While doing a final sanity check before merging a topic Bsomething, it is
a good idea to review what damage Bsomething branch would make, by running:

    $ git diff ...Bsomething

I however find myself often typing "git diff ...B<TAB>", seeing nothing
happening and then repeatedly hitting <TAB>, saying "huh? <TAAAAAAAAB>!".

This change would hopefully help me, and others like me.

Even though there is no point in supporting "git diff A..B" (you can say
"git diff A B" just fine), but reusing complete-revlist was the easiest
and that form is supported as a benign but not so useful side effect.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---

 * I sent this out a while ago and have been using it ever since, but
   totally forgot about it.  Likes, dislikes, alternatives?

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 64341d5..cf56514 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1137,7 +1137,7 @@ _git_diff ()
 		return
 		;;
 	esac
-	__git_complete_file
+	__git_complete_revlist
 }
 
 __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]