Re: 'git show' with multiple revisions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ed Avis <eda@xxxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]