summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-05 11:24:56 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-05 21:36:36 (GMT)
commite5d5b21fdf0ec0aebbfaca814a15d15a718544a2 (patch)
treeae7c510ffd1494179a430ed99e87d9a59dd9c8a3 /contrib/completion
parent873537fadc9bdc35726d1c69c46926c7f5c49dd2 (diff)
downloadgit-e5d5b21fdf0ec0aebbfaca814a15d15a718544a2.zip
git-e5d5b21fdf0ec0aebbfaca814a15d15a718544a2.tar.gz
git-e5d5b21fdf0ec0aebbfaca814a15d15a718544a2.tar.bz2
Support bash completion on symmetric difference operator.
Now that log, whatchanged, rev-list, etc. support the symmetric difference operator '...' we should provide bash completion for it just like we do for '..'. While we are at it we can remove two sed invocations during the interactive prompt and replace them with internal bash operations. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f258f2f..e4a32b6 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -222,11 +222,16 @@ _git_ls_tree ()
_git_log ()
{
- local cur="${COMP_WORDS[COMP_CWORD]}"
+ local pfx cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
+ *...*)
+ pfx="${cur%...*}..."
+ cur="${cur#*...}"
+ COMPREPLY=($(compgen -P "$pfx" -W "$(__git_refs)" -- "$cur"))
+ ;;
*..*)
- local pfx=$(echo "$cur" | sed 's/\.\..*$/../')
- cur=$(echo "$cur" | sed 's/^.*\.\.//')
+ pfx="${cur%..*}.."
+ cur="${cur#*..}"
COMPREPLY=($(compgen -P "$pfx" -W "$(__git_refs)" -- "$cur"))
;;
*)