Re: [PATCH 1/2] completion: create variable for untracked file modes
- From
Jeff King <peff@peff.net>
- Date
- Jun 1, 2016, 04:05 UTC
- Message-ID
- <20160601040542.GA18978@sigill.intra.peff.net>
- In-Reply-To
- <5a3d279f-d3cc-90ec-a0e7-90b7ef438966@virtuell-zuhause.de>
On Wed, Jun 01, 2016 at 01:42:33AM +0200, Thomas Braun wrote:
Show 17 quoted lines
> Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
> ---
> contrib/completion/git-completion.bash | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 3402475..57a0acc 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1098,6 +1098,8 @@ _git_clone ()
> esac
> }
> +__git_untracked_file_modes="all no normal"
> +
> _git_commit ()
> {
> case "$prev" inThere's something funny about the formatting of your patch. The first "+" line is indented, which it shouldn't be. As it is, it looks like context (but it's not actually part of the preimage). But if it's not context, then you are missing a context line.
It kind of looks like you put a literal "+__git_untracked..." line in the file and then committed, then added the next line, and committed that. Or you edited the patch by hand.
Anyway, I couldn't actually apply it.
Show 6 quoted lines
> @@ -1119,7 +1121,7 @@ _git_commit ()
> return
> ;;
> --untracked-files=*)
> - __gitcomp "all no normal" "" "${cur##--untracked-files=}"
> + __gitcomp "$(__git_untracked_file_modes)" "" "${cur##--untracked-files=}"Your __git_untracked_file_modes is a variable, but "$()" will run it as a command. You want just "$__git_untracked_file_modes", or to make it into a function.
-Peff