From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Tue, 27 Aug 2013 03:37:37 +0200 Subject: [PATCH/RFC 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting In-Reply-To: References: <1377566827-2136-1-git-send-email-cgit@cryptocrack.de> Message-ID: <20130827013737.GB5933@blizzard> On Tue, Aug 27, 2013 at 03:31:14AM +0200, Jason A. Donenfeld wrote: > > > > On Tue, Aug 27, 2013 at 3:27 AM, Lukas Fleischer wrote: > > + } else { > + /* > + * SHA-1 of an empty tree. We might be better off > not > + * hardcoding this. > + */ > + get_sha1 > ("4b825dc642cb6eb9a060e54bf8d69288fbee4904", > + old_tree_sha1); > + } > + > > > What's the story here? This is needed if we want to build a diff for the root commit. It doesn't have any parent, so we need to build against the empty tree. I am pretty sure there are better ways to do this -- just too tired to check now (hence the "RFC" in the subject).