Re: [PATCH] completion: add completer for status

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

 



Hi,

On Mon, Jun 24, 2013 at 10:52:55PM +0530, Ramkumar Ramachandra wrote:
> Signed-off-by: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
> ---
>  contrib/completion/git-completion.bash | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 6c3bafe..912fb98 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1695,6 +1695,32 @@ _git_stage ()
>  	_git_add
>  }
>  
> +_git_status ()
> +{
> +	case "$cur" in
> +	--untracked-files=*)
> +		__gitcomp "no normal all" "" "${cur##--untracked-files=}"
> +		return
> +		;;
> +	--ignore-submodules=*)
> +		__gitcomp "none untracked dirty all" "" "${cur##--ignore-submodules=}"
> +		return
> +		;;
> +	--column=*)
> +		__gitcomp "always never auto column row plain dense nodense" "" "${cur##--column=}"
> +		return
> +		;;
> +	--*)
> +		__gitcomp "
> +			--short --branch --long --porcelain
> +			--untracked-files= --ignore-submodules= --ignored --column=

The parameter for '--untracked-files' '--ignore-submodules' and
'--column' is optional.  In such cases we usually list the option both
with and without the '=' as a reminder, e.g. look at 'git log's
'--decorate' and '--dirstat'.

> +			"
> +		return
> +		;;
> +	esac
> +	__git_complete_index_file

With or without this change we can't ask for the status of a certain
deleted file:

$ git rm version.h
rm 'version.h'
$ git status 
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       deleted:    version.h
#
$ git status v<TAB>
varint.c   varint.h   vcs-svn/   version.c  

I wonder whether there is some clever combination of options that
would make that possible?  I didn't find it.


Gábor

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