Re: log/show: relative pathnames do not work in rev:path
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Dec 18, 2007, 23:11 UTC
- Message-ID
- <200712190011.52613.jnareb@gmail.com>
- In-Reply-To
- <Pine.LNX.4.64.0712182239500.23902@racer.site>
Johannes Schindelin wrote:
Show 14 quoted lines
> On Tue, 18 Dec 2007, Alex Riesen wrote: >> Jakub Narebski, Tue, Dec 18, 2007 22:24:26 +0100: >>> >>> What cwd? <path> in <tree-ish>:<path> syntax is "relative" to >>> <tree-ish>. >> >> But the act of running "git-show <tree-ish>:<path>" does have a working >> directory relative to the project root. > > Not necessarily. My primary use of "git show <tree-ish>:<path>" (yes, I > already use the dash-less form ;-) is in _bare_ repositories. > > And I still maintain that expecting <tree-ish>:<path> to take the current > relative path into account would be just like if you expected
[...]
> $ cd /usr/bin > $ scp home:bash ./ > > No, this does not copy home:/usr/bin/bash but home:$HOME/bash.
Great example! In scp <machine>:<path>, <path> by default is relative to the login (ssh) directory on <machine>. In git's <tree-ish>:<path>, <path> by default is relative to <tree-ish>.
Although Linus argument about thinking that cwd affects translation from _commit_ sha1 to _tree-ish_ is also sound. Nevertheless I'd rather have separate syntax for cwd-relative paths, i.e. <commit>:./<relpath>.
-- Jakub Narebski Poland