Re: svn versus git
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Dec 15, 2006, 11:35 UTC
- Message-ID
- <elu15f$u0i$2@sea.gmane.org>
- In-Reply-To
- <m2slfilbfi.fsf@ziti.local>
Seth Falcon wrote:
Show 22 quoted lines
> Shawn Pearce <spearce@spearce.org> writes: > >> Andy Parkins <andyparkins@gmail.com> wrote: >>> svn cat:: >>> Output the contents of specified files or URLs. Optionally at a >>> specific revision. >>> git cat-file -p $(git-ls-tree $REV $file | cut -d " " -f 3 | cut -f 1):: >> >> better: >> >> git cat-file -p $REV:$file > > FWIW, after some amount of git experience, I had a need for git > cat-file and I found it hard to use. Why? Because following the > pattern of some other commands, I really expected the following to work: > > git cat-file -p HEAD^2 $file > > Since that is similar to > > git diff HEAD^^ $file > git checkout HEAD $file
You mean
git diff HEAD^^ -- $file
git checkout HEAD -- $fileIt's not $file, it is $path, and it is limiter. git-cat-file (the name
is certainly historical artefact and it should be git-cat-object) doesn't
support limiters.
> Where else uses the colon syntax?
Everything where you have <object> or <tree-ish> you can use colon syntax. For example:
$ git ls-tree pu:Documentation $ git grep -e --merge next:Documentation $ git diff v1.4.2:gitweb/gitweb.cgi gitweb/web:gitweb/gitweb.perl
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git