From: Jeff King Date: Wed, 12 Nov 2008 19:15:13 GMT Subject: Re: [PATCH] git-diff: Add --staged as a synonym for --cached. Message-ID: <20081112191512.GA21401@coredump.intra.peff.net> In-Reply-To: <32541b130811120739t95455d8n9b8056a8033491c3@mail.gmail.com> On Wed, Nov 12, 2008 at 10:39:21AM -0500, Avery Pennarun wrote: > > I thought about that at first, too, but the working tree is even more > > painful. You would have to hash every changed file on the filesystem to > > create the tree object. > > Is that so bad? You have to read all those files anyway in order to > do a diff. I don't know for sure, as I haven't tried it. But you would need to read them twice (once to hash, and then once to diff) plus the extra computation time of hashing. So assuming you have a decent cache, you pay the disk access only once. Maybe it would be negligible, but I would have to see numbers to be convinced either way. -Peff