Re: [RFD/BUG?] git show with tree/commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 12, 2016, 16:50 UTC
- Message-ID
- <xmqqzisyrcsu.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160412163420.GA23462@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> On Tue, Apr 12, 2016 at 05:33:33PM +0200, Michael J Gruber wrote: > >> $ git show cab2cdadfda8e8e8631026443b11d3ed6e7ba517: >> tree cab2cdadfda8e8e8631026443b11d3ed6e7ba517: >> >> .gitattributes >> .gitignore >> .mailmap >> ... > > As Junio pointed out, the colon here is not syntactic, but from the > original object name you gave it. But here... > >> $ git show 04050d37b1676ba8da277be1902513049b45413a: >> tree 04050d37b1676ba8da277be1902513049b45413a >> >> .gitattributes >> .gitignore >> .mailmap >> ... > > ...it is missing. Did you mean to omit it from the command-line?
I suspect that is cut-and-paste something. I see:
$ git show 04050d37b1676ba8da277be1902513049b45413a: | head -n1
tree 04050d37b1676ba8da277be1902513049b45413a:
$ git show 04050d37b1676ba8da277be1902513049b45413a | head -n1
tree 04050d37b1676ba8da277be1902513049b45413awhich is expected.
It indeed becomes confusing when you give "<treeish>:" from the command line, as it looks as if there is conceptually a list of tree contents that is shown like so:
tree tree1:
contents of tree1 tree tree2:
contents of tree2
...and we are showing only the first one. If the original input were given as "<treeish>^{tree}", there is no confusion.