Re: [PATCH] Change git-rev-parse --show-cdup to output an absolute path
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Apr 26, 2007, 08:20 UTC
- Message-ID
- <81b0412b0704260120mda8a2abhe343f5c127945939@mail.gmail.com>
- In-Reply-To
- <20070425232829.GA15930@midwinter.com>
On 4/26/07, koreth@midwinter.com <koreth@midwinter.com> wrote:
Show 6 quoted lines
> 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.
Show 5 quoted lines
> 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.