From: Shawn O. Pearce Date: Tue, 04 Sep 2007 02:51:54 GMT Subject: Re: Calculating tree nodes Message-ID: <20070904025153.GS18160@spearce.org> In-Reply-To: <9e4733910709031913q278cb9dbp441756afb28607c6@mail.gmail.com> Jon Smirl wrote: > When I change a file it creates a new object with a new SHA. This new > SHA causes the tree node pointing to it to change. Changing the tree > node forces its parent to change and so on. Of course git batches all > of the changes together into a commit so that this ripple effect > doesn't happen for every file. But every commit causes a new root tree > node to be created, right? Only if at least one file (or tree) differed. This may not be the case if you do a merge with the ours merge strategy, but these are very rare. So you can pretty much just say that yes, every commit causes a new root tree to be created. Usually the smallest number of objects created per commit is 3: - the new commit - the new root tree - the new blob for a file in the root directory The number increases as more files are modified or if they are in subdirectories of the root. -- Shawn.