git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: hitting home directory's parent

From
Jeff King <peff@peff.net>
Date
Aug 22, 2009, 18:16 UTC
Message-ID
<20090822181607.GA25823@coredump.intra.peff.net>
In-Reply-To
<fcaeb9bf0908220920g29ec24e9v23d0504d10ca6cfb@mail.gmail.com>
On Sat, Aug 22, 2009 at 11:20:39PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 9 quoted lines
> > 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().

As for fixing the setup code, I am sadly way behind on my git queue and not likely to catch up to this anytime soon. So if anybody feels like taking a stab at it, that would be very welcome.

-Peff
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 6 of 11 in “hitting home directory's parent”
  1. Daniel ConvissorAug 21, 2009
  2. Nguyen Thai Ngoc DuyAug 22, 2009
  3. Daniel ConvissorAug 22, 2009
  4. Nguyen Thai Ngoc DuyAug 22, 2009
  5. Nguyen Thai Ngoc DuyAug 22, 2009
  6. Jeff KingAug 22, 2009
  7. Nguyen Thai Ngoc DuyAug 23, 2009
  8. Jeff KingAug 25, 2009
  9. Daniel ConvissorAug 23, 2009
  10. Jeff KingAug 25, 2009
  11. Daniel ConvissorAug 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.