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: Bart Trojanowski <bart [ at ] jukie [ dot ] ca>
  • Date: Tue, 24 Jan 2012 17:00:57 -0500
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.

-Bart