Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] Change git-rev-parse --show-cdup to output an absolute path

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:07

On 4/26/07, koreth@midwinter.com [off-list ref] wrote:
I have a symlink pointing to a subdirectory of a repo of mine. If I cd
to that symlink, some shell-script git commands don't work.  Shell scripts
use the PWD environment variable as the working directory, and the chain
of "../"s from git-rev-parse --show-cdup just peels entries off that
variable. That's fine when PWD is a real path, but not so great when it's
a reference to a symlink from an outside directory.
Your implementation will fail if cwd is longer than PATH_MAX.
Does not happen often, though.
A typical failure case:

$ git clone git://whatever.git foobar
$ ln -s foobar/src/tools/misc/myapp myapp
$ cd myapp
Which is a strange thing to do. What is that for?
myapp is kind of outside the git repo foobar.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help