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

Re: [PATCH] Git.pm: Always set Repository to absolute path if autodetecting

From
Frank Lichtenheld <frank@lichtenheld.de>
Date
Apr 18, 2009, 21:02 UTC
Message-ID
<20090418210225.GC17706@mail-vs.djpig.de>
In-Reply-To
<alpine.DEB.1.00.0904182012330.10279@pacific.mpi-cbg.de>
On Sat, Apr 18, 2009 at 08:13:05PM +0200, Johannes Schindelin wrote:
Show 7 quoted lines
> On Sat, 18 Apr 2009, Frank Lichtenheld wrote:
> 
> > So far we only set it to absolute paths in some cases which lead to 
> > problems like wc_chdir not working.
> 
> We had something similar in setup.c until Linus pointed out that it 
> deteriorates performance.
You mean 044bbbcb63281dfdb78344ada2c44c96122dc822 ?

I don't think we're talking about the same issue here. The code in setup.c prepares a variable for usage inside the running git command, while the Perl code needs to prepare a variable for calling a git command, i.e. the content of the GIT_DIR environment variable. As you can see from the code in setup.c git will in fact make that content absolute before making it relative again, so no harm should come from the fact that we're giving it an already absolute value.

Also if we're giving it a relative path it will interpret it relative to the current working directory and not GIT_WORK_TREE, so we should in fact not store it relative because we would need to recalculate it after wc_chdir, which is exactly what's causing problems.

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
Previous: Johannes Schindelin
Message 4 of 4 in “Git.pm: Set GIT_WORK_TREE if we set GIT_DIR”
  1. Git.pm: Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld, Apr 18, 2009
  2. Git.pm: Always set Repository to absolute path if autodetectingFrank Lichtenheld, Apr 18, 2009
  3. Johannes SchindelinApr 18, 2009
  4. Frank LichtenheldApr 18, 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.