Re: [PATCH] bash: support 'git notes' and its subcommands

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

 



On Thursday 28 January 2010, SZEDER Gábor wrote:
> ... and it will offer refs unless after -m or -F, because these two
> options require a non-ref argument.

Maybe-NAK.

The patch is probably good in itself, and the intent is certainly good, but 
we're currently discussing deprecating the -m/-F options to "git notes edit" 
(see http://article.gmane.org/gmane.comp.version-control.git/138215), and if 
that's where we go, there's no point "encouraging" their use by adding bash-
completions for them...


...Johan

> 
> Signed-off-by: SZEDER Gábor <szeder@xxxxxxxxxx>
> ---
>  contrib/completion/git-completion.bash |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash
>  b/contrib/completion/git-completion.bash index 9651720..8b56c34 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1306,6 +1306,24 @@ _git_name_rev ()
>  	__gitcomp "--tags --all --stdin"
>  }
> 
> +_git_notes ()
> +{
> +	local subcommands="edit show"
> +	if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
> +		__gitcomp "$subcommands"
> +		return
> +	fi
> +
> +	case "${COMP_WORDS[COMP_CWORD-1]}" in
> +	-m|-F)
> +		COMPREPLY=()
> +		;;
> +	*)
> +		__gitcomp "$(__git_refs)"
> +		;;
> +	esac
> +}
> +
>  _git_pull ()
>  {
>  	__git_complete_strategy && return
> @@ -2218,6 +2236,7 @@ _git ()
>  	merge-base)  _git_merge_base ;;
>  	mv)          _git_mv ;;
>  	name-rev)    _git_name_rev ;;
> +	notes)       _git_notes ;;
>  	pull)        _git_pull ;;
>  	push)        _git_push ;;
>  	rebase)      _git_rebase ;;
> 


-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
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]