Subject: Re: 'git show' with multiple revisions

From: Junio C Hamano <[email-masked]>
Date: Wed, 29 Apr 2015 08:53:24 -0700

Ed Avis <[email-masked]> writes:

> Jeff King <peff <at> peff.net> writes:
>
>>I think you want `git cat-file`:
>>
>>  {
>>	echo REV1:FILE
>>	echo REV2:FILE
>>  } |
>>  git cat-file --batch
>>
>>This prints a header line for each output object which contains the size
>>of the object (so a parser reads a header line, then N bytes, then a
>>header line, N bytes, and so on).
>
> This looks like what I want but the object ids printed appear to be the id
> of the file in a given revision - not the id of the revision itself.
> So the ids in the output are not the same as the ones in the input.

Actually you are asking for REV1:FILE and REV2:FILE, and you are
getting these object IDs in the output (you are not asking for REV1
or REV2 henace you will not see these commit object IDs).

"cat-file --batch" will give you the objects in the order you ask.
I _think_ you can even do that interactively (i.e. you spawn the
process, you feed one object name to its input, you consume its
output by reading the header and then given number of bytes, and
then you feed the next object name to its input, and so on) without
deadlocking yourself.