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 13:32:36 -0500
On Tue, Jan 24, 2012 at 11:20 AM, Robert P. J. Day
<rpjday [ at ] crashcourse [ dot ] ca> wrote:
>
>  in order to demonstrate what happens in the .git directory for a
> single commit, i'd like the simplest way to list all of the new
> objects that were added to the .git directory given changing a single
> file and committing that change.
>
>  for example, let's say i've checked out the kernel source tree and
> make a trivial change to a file five subdirectories down, then commit
> that single file change.  if i understand it correctly, the following
> objects will have to be created and added to the .git object set:
>
> * a new blob for the new file
> * 5 new trees, one for each subdirectory all the way down to the
>  changed file
> * a new commit object
>
>  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.

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...

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.