[PATCH/RFC 1/2] ui-diff: Use diff_tree_sha1() for raw diff formatting

Lukas Fleischer cgit at cryptocrack.de
Tue Aug 27 03:37:37 CEST 2013


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 <cgit at cryptocrack.de> 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).


More information about the CGit mailing list