RFC fixing git pull from symlinked directory
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | Add failing test for "git pull" in symlinked directoryt/ | +67 | 0 replies | |
| 2/2 | Support shell scripts that run from symlinks into a git working dirgit-sh-setup.sh | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] fixing git pull from symlinked directory
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