From e14540ac023451a53586b4d2fad00d22c4e98166 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 18 Nov 2015 23:15:41 +0000 Subject: 37150: _git: Autocomplete .. for commit ranges This patch makes three changes: - Enable 'git diff o/m' to complete to 'origin/master..' with the ".." being autoremovable. This is implemented by the first hunk. That hunk is a functional subset of Oliver's users/20705, however, the latter hasn't been committed. - Make typing "^" remove the "..", in light of the syntax "foo^..bar". - Make typing "." _not_ remove the ".." but simply append it, since "foo...bar" is a valid and useful syntax. --- ChangeLog | 3 +++ Completion/Unix/Command/_git | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a845da630..eb25e08d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-12-05 Daniel Shahaf + * 37150: Completion/Unix/Command/_git: _git: Autocomplete .. for + commit ranges + * 36957: Completion/Unix/Command/_git: _git: Apply matchspecs to filename completion such as 'git log f/b' → 'foo/bar.txt's diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2030321de..2a124c18c 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5623,8 +5623,8 @@ __git_commits () { (( $+functions[__git_heads] )) || __git_heads () { - __git_heads_local - __git_heads_remote + __git_heads_local "$@" + __git_heads_remote "$@" } (( $+functions[__git_heads_local] )) || @@ -5815,7 +5815,7 @@ __git_commit_ranges () { if [[ ${PREFIX} = (#b)((\\|)\^)* ]]; then compset -p ${#match[1]} else - suf=( -S .. -r '.@~ ^:\t\n\-' ) + suf=( -S .. -r '@~ \^:\t\n\-' ) fi fi expl=( $* $suf ) -- cgit 1.4.1