Re: log/show: relative pathnames do not work in rev:path
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 18, 2007, 23:02 UTC
- Message-ID
- <Pine.LNX.4.64.0712182250040.23902@racer.site>
- In-Reply-To
- <56b7f5510712181430w798d4a65x20a24f061c5d0eb6@mail.gmail.com>
Hi,
On Tue, 18 Dec 2007, Dana How wrote:
> [lots about rev:path taking path to be relative to the project root, > preferring it to be relative to the current prefix instead] > > Typing an extra "./" is a big improvement over a long path prefix.
Have you tried the path completion?
Alternatively, I suggest making a script
$ cat > $HOME/bin/git-showrel << \EOF #!/bin/sh git show "$(echo "$1" | sed "s|:|:$(git rev-parse --show-prefix)|")" EOF $ chmod a+x $HOME/bin/git-showrel
Then
$ git showrel HEAD:file
will do what you want.
(An alias will not work, since the cwd will be the project root.)
Hth, Dscho
P.S.: I just tried "git show HEAD~20:<filename with : in it>" and it did not work... I consider this a more serious issue than the relative path one.