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

[RFC PATCH 0/2] fixing git pull from symlinked directory

From
Marcel M. Cary <marcel@oak.homeunix.org>
Date
Nov 15, 2008, 15:11 UTC
Message-ID
<cover.1226759762.git.marcel@oak.homeunix.org>

In a past message I described a problem when pulling in a directory that I arrived at by "cd"-ing to a symlink.

http://article.gmane.org/gmane.comp.version-control.git/98223

I've created a unit test to illustrate the problem and compare it to "git pull" without the symlink and "git push" with the symlink, which both work. That's the first patch in this series.

I think the root cause here is that a shell's "cd" and C's chdir() behave slightly different with symlinks. See the unit test comments for more details.

I can make the unit test pass if I make bash's "cd" behave like chdir() by adding "-P", as in the second patch of this series, but I think that has portability issues. Any tips for addressing that? Maybe instead call realpath() on the result of "git rev-parse --show-cdup" in C before printing it? That's a substantial change as it would print /full/path/to/work-dir/ instead of just "../".

Marcel M. Cary (2):
  Add failing test for "git pull" in symlinked directory
  Support shell scripts that run from symlinks into a git working dir
 git-sh-setup.sh         |    2 +-
 t/t5521-pull-symlink.sh |   67 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletions(-)
 create mode 100644 t/t5521-pull-symlink.sh
Next: Marcel M. Cary
Message 1 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.