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

Re: [PATCH] t9903: Don't fail when run from path accessed through symlink

From
Jeff King <peff@peff.net>
Date
Apr 11, 2013, 19:17 UTC
Message-ID
<20130411191749.GD3177@sigill.intra.peff.net>
In-Reply-To
<20130411185322.GF14619@pvv.ntnu.no>
On Thu, Apr 11, 2013 at 08:53:22PM +0200, Torstein Hegge wrote:
Show 12 quoted lines
> When the git directory is accessed through a symlink like
> 
>   ln -s /tmp/git /tmp/git-symlink
>   cd /tmp/git-symlink/t
>   make -C .. && ./t9903-bash-prompt.sh
> 
> $TRASH_DIRECTORY is /tmp/git-symlink/t/trash directory.t9903-bash-prompt
> and $(pwd -P) is /tmp/git/t/trash directory.t9903-bash-prompt.
> 
> When __gitdir looks up the path through 'git rev-parse --git-dir', it
> will return paths similar to $(pwd -P). This behavior is already tested in
> t9903 'gitdir - resulting path avoids symlinks'.

Thanks, this makes sense to me, and is the same solution used in other scripts (e.g., t2300), so I don't think we have to worry about any portability concerns with "pwd -P".

-Peff
Previous: Torstein Hegge
Message 2 of 2 in “t9903: Don't fail when run from path accessed through symlink”
  1. t9903: Don't fail when run from path accessed through symlinkTorstein Hegge, Apr 11, 2013
  2. Jeff KingApr 11, 2013

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.