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

Re: log/show: relative pathnames do not work in rev:path

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:00

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help