home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] a git (plumbing?) command to show all objects added by a commit?

  • Subject: Re: [OCLUG-Tech] a git (plumbing?) command to show all objects added by a commit?
  • From: Aidan Van Dyk <aidan [ at ] highrise [ dot ] ca>
  • Date: Tue, 24 Jan 2012 18:11:16 -0500
On Tue, Jan 24, 2012 at 5:00 PM, Bart Trojanowski <bart [ at ] jukie [ dot ] ca> wrote:
> On Tue, Jan 24, 2012 at 13:32, Aidan Van Dyk <aidan [ at ] highrise [ dot ] ca> wrote:
>>
>> >  does that sound about right?  and is there a single command that
>> > would show all of that new content?  thanks.
>>
>> I think the easiest way would be to pack everything before you start,
>> and then after your commit, just look at all the loose objects made.
>
>
> That's probably the best way.
>
>>
>> Or if you want to work backwards from 1st principles, you can work
>> with cat-file to show them from the commits through the trees/files
>> how things (objects and their SHA1s) have changed...
>
>
> The cat-file approach would be painful, since git doesn't track diffs, but
> rather the state.  There is no way to know which of the 37k files of the
> linux kernel changed... at least not with cat-file alone.
>
> You probably want something like: git diff-tree -t HEAD
> (which is semantically equivalent to git diff-tree -t HEAD~1 HEAD)
>
> You can then use the hashes from diff-tree output and send those to
> cat-file.

So with cat-file on theommit, you can show explicitly that the commit
tracks different trees, and with diff-tree and ls-tree, you can show
exactly what objects are different in the trees...

And of course, since it's git, you don't actually need to give exact
sha1's to diff-tree and ls-tree, anything "tree-ish" is good enough...

a.


-- 
Aidan Van Dyk                                             Create like a god,
aidan [ at ] highrise [ dot ] ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.