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

Re: [PATCH] rev-parse: Fix shell scripts whose cwd is a symlink into a git work-dir

From
Marcel M. Cary <marcel@oak.homeunix.org>
Date
Nov 25, 2008, 16:16 UTC
Message-ID
<492C24D4.1010306@oak.homeunix.org>
In-Reply-To
<492BA998.5050106@viscovery.net>
Johannes Sixt wrote:
Show 7 quoted lines
> Marcel M. Cary schrieb:
>> * Change "git rev-parse --show-cdup" to print a full path instead of
>>   a series of "../" when it prints anything
> 
> http://thread.gmane.org/gmane.comp.version-control.git/88557/focus=88562
> 
> I don't see that you bring in any new arguments.
To be clear, as mentioned here:
http://thread.gmane.org/gmane.comp.version-control.git/88557/focus=88573

I'm not talking about a situation where the symlink is in the working tree pointing outwards. I'm talking about a symlink outside pointing in. And as mentioned later in that thread, the --work-tree workaround doesn't actually work.

One new thing I have to add is that the reason --show-cdup prints a correct path but pull fails is because it's the *shell* who misinterprets the path. So telling git rev-parse where the work-tree is helps nothing. It already knows.

http://thread.gmane.org/gmane.comp.version-control.git/88557/focus=88581

So far I've seen no response to the idea, which Yves mentions, about trying to restrict the absolute path behavior to times when bash would interpret the "../" incorrectly.

Nor have I seen a response to the idea of correcting the shell's behavior in cd_to_toplevel, for example by adding a "cd `pwd`", and I don't really understand the scenario where this would be a performance concern; I think I haven't found a particular discussion that several people have referenced. Perhaps I should prepare a patch for that so I can verify that it works as I expect and so we have something more concrete to discuss?

Any tips on how to follow the reference 7vk5sly3h9.fsf@assigned-by-dhcp.cox.net in the first url above? It looks to be about performance. Message-Id seems to not be indexed for searching.

Marcel
Previous: Johannes SixtNext: Johannes Sixt
Message 11 of 27 in “fixing git pull from symlinked directory”
  1. 0/2 fixing git pull from symlinked directoryMarcel M. Cary, Nov 15, 2008
  2. 1/2 Add failing test for "git pull" in symlinked directoryMarcel M. Cary, Nov 15, 2008
  3. 2/2 Support shell scripts that run from symlinks into a git working dirMarcel M. Cary, Nov 15, 2008
  4. rev-parse: Fix shell scripts whose cwd is a symlink into a git work-dirMarcel M. Cary, Nov 22, 2008
  5. Jakub NarebskiNov 22, 2008
  6. Andreas EricssonNov 23, 2008
  7. Marcel M. CaryNov 25, 2008
  8. Andreas EricssonNov 25, 2008
  9. Marcel M. CaryNov 25, 2008
  10. Johannes SixtNov 25, 2008
  11. Marcel M. CaryNov 25, 2008
  12. Johannes SixtNov 25, 2008
  13. Junio C HamanoNov 25, 2008
  14. git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dirMarcel M. Cary, Dec 3, 2008
  15. Junio C HamanoDec 3, 2008
  16. git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dirMarcel M. Cary, Dec 10, 2008
  17. Junio C HamanoDec 10, 2008
  18. git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dirMarcel M. Cary, Dec 13, 2008
  19. Junio C HamanoDec 14, 2008
  20. git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dirMarcel M. Cary, Dec 15, 2008
  21. Marcel M. CaryDec 15, 2008
  22. git-sh-setup: Use "cd" option, not /bin/pwd, for symlinked work treeMarcel M. Cary, Feb 7, 2009
  23. Johannes SchindelinFeb 7, 2009
  24. Marcel M. CaryFeb 8, 2009
  25. Johannes SchindelinFeb 8, 2009
  26. Marcel M. CaryFeb 11, 2009
  27. Jeff KingFeb 11, 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.