From: Shawn O. Pearce Date: Sun, 27 Apr 2008 17:19:56 GMT Subject: Re: [PATCH] bash: Add completion for gitk --merge Message-ID: <20080427171956.GK29771@spearce.org> In-Reply-To: <1209310510-7201-1-git-send-email-richard.quirk@gmail.com> Richard Quirk wrote: > Option is only completed when .git/MERGE_HEAD is present. > > Signed-off-by: Richard Quirk Thanks for fixing the unnecessary local and resubmitting. Acked-by: Shawn O. Pearce > --- > contrib/completion/git-completion.bash | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash > index 665a895..23db664 100755 > --- a/contrib/completion/git-completion.bash > +++ b/contrib/completion/git-completion.bash > @@ -1346,9 +1346,14 @@ _git () > _gitk () > { > local cur="${COMP_WORDS[COMP_CWORD]}" > + local g="$(git rev-parse --git-dir 2>/dev/null)" > + local merge="" > + if [ -f $g/MERGE_HEAD ]; then > + merge="--merge" > + fi > case "$cur" in > --*) > - __gitcomp "--not --all" > + __gitcomp "--not --all $merge" > return > ;; > esac > -- > 1.5.5.1.79.g57cf > -- Shawn.