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

Re: [PATCH] Fix git_setup_directory_gently when GIT_DIR is set

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 5, 2006, 23:21 UTC
Message-ID
<Pine.LNX.4.63.0606060117180.25685@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vk67v2o85.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 5 Jun 2006, Junio C Hamano wrote:
Show 23 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hi,
> >
> > On Mon, 5 Jun 2006, Junio C Hamano wrote:
> >
> >> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >> 
> >> > When calling git_setup_directory_gently, and GIT_DIR was set, it just
> >> > ignored the variable nongit_ok.
> >> 
> >> Hmph.  Is this really a breakage?  That is, gently() is meant
> >> for a case where you do not know if you even find a git
> >> repository and tell it not to complain because you are prepared
> >> for the case where you are not in a git repository.
> >
> > Yes, it is a breakage: in git-clone, line 212, we explicitely set GIT_DIR 
> > (to the not-yet-existing repository path), and call git-init-db. Now, with 
> > the alias thing we need to get the config if it exists, so we _got_ to 
> > call gently(). Boom.
> 
> Hmph.  Would it be a bug in clone that does not create GIT_DIR
> then?

I don't think so. The whole point in calling git-init-db is to create that. GIT_DIR is set so that the otherwise nice work-in-a-subdirectory does not kick in. Imagine for example:

	git-clone ./. victim

(taken straight out of t5400). If GIT_DIR was not set, git-init-db (which reads repositoryformat from the config if that exists, right?) would find .git/ in git/t/trash, and _not_ create git/t/trash/victim/.git/.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 8 in “Fix git_setup_directory_gently when GIT_DIR is set”
  1. Fix git_setup_directory_gently when GIT_DIR is setJohannes Schindelin, Jun 5, 2006
  2. Junio C HamanoJun 5, 2006
  3. Johannes SchindelinJun 5, 2006
  4. Junio C HamanoJun 5, 2006
  5. Johannes SchindelinJun 5, 2006
  6. Junio C HamanoJun 5, 2006
  7. Junio C HamanoJun 6, 2006
  8. Johannes SchindelinJun 6, 2006

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.