From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Daniel Convissor <danielc@analysisandsolutions.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: hitting home directory's parent
Date: Sun, 23 Aug 2009 11:07:39 +0700 [thread overview]
Message-ID: <fcaeb9bf0908222107i6d999335r998a304aaa3cd405@mail.gmail.com> (raw)
In-Reply-To: <20090822181607.GA25823@coredump.intra.peff.net>
On Sun, Aug 23, 2009 at 1:16 AM, Jeff King<peff@peff.net> wrote:
> On Sat, Aug 22, 2009 at 11:20:39PM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> > I did read a bit farther in the manual and initialized a new repository.
>> > Issuing "git --help" once inside that new repository works. Requiring
>> > the --help command to be called from inside a repository, or even that
>> > it's looking for a repository at all, seems unwise. All it should do is
>> > display the usage information and exit.
>>
>> For simple things like --help, I agree Git should not do extra work
>> such as searching for Git repository, which is the cause. That was on
>> Jeff's plan IIRC.
>
> Without looking, I would not be surprised if it is a side effect of
> git trying to look up help-related config. So I don't think it is a
> problem exactly that it checks to see if it is in a repo (which would
> impact config lookup), but that inability to find a repo is a hard
> error.
>
> Probably it is calling "setup_git_directory_gently" and ignoring an
> error return, but there is a die() inside that function. The bug
> then is that the _gently form is calling die().
It is (and should be worked around with GIT_CEILING_DIRECTORIES).
Unfortunately in my test, it could not chdir() back when it failed to
find gitdir. chdir() was called with an absolute directory, and one
directory in that path was inaccesible, leading another die("Cannot
come back to cwd"). This one is fatal and should not be ignored. I
don't know whether having an inaccesible parent directory is a real
scenario, as lots of tools would break.
--
Duy
next prev parent reply other threads:[~2009-08-23 4:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 20:05 hitting home directory's parent Daniel Convissor
2009-08-22 4:10 ` Nguyen Thai Ngoc Duy
2009-08-22 15:05 ` Daniel Convissor
2009-08-22 16:20 ` Nguyen Thai Ngoc Duy
2009-08-22 16:22 ` Nguyen Thai Ngoc Duy
2009-08-22 18:16 ` Jeff King
2009-08-23 4:07 ` Nguyen Thai Ngoc Duy [this message]
2009-08-25 4:42 ` Jeff King
2009-08-23 5:12 ` Daniel Convissor
2009-08-25 4:48 ` Jeff King
2009-08-23 4:42 ` Daniel Convissor
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=fcaeb9bf0908222107i6d999335r998a304aaa3cd405@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=danielc@analysisandsolutions.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).