Re: [PATCH] bash: Add completion for gitk --merge

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

 



Richard Quirk <richard.quirk@xxxxxxxxx> wrote:
> Option is only completed when .git/MERGE_HEAD is present.
> 
> Signed-off-by: Richard Quirk <richard.quirk@xxxxxxxxx>
> ---
>  contrib/completion/git-completion.bash |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)

Nice.
 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 665a895..2565aa6 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
> +		local merge="--merge"

I don't think the extra "local" is necessary within the if block;
you have already declared it to be local when you initialized it
to the empty string.

-- 
Shawn.
--
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]

  Powered by Linux