Re: [PATCH 2/2] git-completion.bash: prevent 'git help' from searching for git repository

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

 



Gerrit Pape <pape@xxxxxxxxxxx> writes:

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index bf688e1..a55e3cd 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -500,7 +500,7 @@ __git_all_commands ()
>  		return
>  	fi
>  	local i IFS=" "$'\n'
> -	for i in $(git help -a|egrep '^ ')
> +	for i in $(git --no-git-dir help -a|egrep '^ ')

Thanks.

What the --no-git-dir option actually does is "pretend that cwd is the git
directory but do not worry if it is not", which is different from "there
is no git directory, so do not barf as long as you do not need to access
git-dir".  The latter is what the name implies, and also additionally it
implies "but please do barf if you ever need to access something from git
directory."  I do not know if that holds true with your Patch 1/2, and I
am a bit too tired to check.

Besides, "git --git-dir=." is shorter to type, and it is equally magical
that the user has to know about it anyway.  Hopefully, most of the time
the end user would not have to use it directly, and the only demonstrated
use case is here in this completion script.

Would it be an option to chuck the Patch 1/2 at least for now and instead
say "git --git-dir=. help -a" here in this patch?
--
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]