git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gerrit Pape <pape@smarden.org>
Cc: Sverre Rabbelier <srabbelier@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] git-completion.bash: prevent 'git help' from searching for git repository
Date: Fri, 04 Sep 2009 02:57:59 -0700	[thread overview]
Message-ID: <7vvdjzxc9k.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20090904092929.23208.qmail@00cf3567a0e8b4.315fe32.mid.smarden.org> (Gerrit Pape's message of "Fri\, 4 Sep 2009 09\:29\:29 +0000")

Gerrit Pape <pape@smarden.org> 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?

  reply	other threads:[~2009-09-04  9:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02  9:58 [PATCH] git-completion.bash: prevent 'git help' from searching for git repository Gerrit Pape
2009-09-02 11:47 ` Sverre Rabbelier
2009-09-04  9:29   ` [PATCH 1/2] git: add new option --no-git-dir Gerrit Pape
2009-09-04  9:29   ` [PATCH 2/2] git-completion.bash: prevent 'git help' from searching for git repository Gerrit Pape
2009-09-04  9:57     ` Junio C Hamano [this message]
2009-09-04 10:22     ` Johannes Schindelin
2009-09-04 11:09       ` Gerrit Pape
2009-09-04 12:35         ` Johannes Schindelin
2009-09-04 12:49           ` Gerrit Pape
2009-09-04 12:52             ` Johannes Schindelin
2009-09-07 19:15               ` Junio C Hamano
2009-10-27 13:30         ` Gerrit Pape
2009-10-28  6:11           ` Junio C Hamano
2009-10-28  9:30             ` [PATCH] help -a: do not unnecessarily look for a repository Gerrit Pape
2009-10-28 20:26               ` Junio C Hamano
2009-09-04  9:43   ` [PATCH] git-completion.bash: prevent 'git help' from searching for git repository Rogan Dawes
2009-09-04 10:32     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vvdjzxc9k.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pape@smarden.org \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).