Subject: Re: Can't diff against the 00000000 revision

From: Junio C Hamano <[email-masked]>
Date: Tue, 12 Jan 2016 10:52:41 -0800

Stefan Monnier <[email-masked]> writes:

>> And hopefully that explains why "000000" does not necessarily make a
>> good placeholder for "the empty thing". There are multiple empty things,
>> and it is not clear what:
>
>>   git diff 0000000 1234abcd
>
>> means. Is 0000000 a tree? A blob?
>
> Well, Git is the one who uses 000000 to refer to an empty thing, but
> indeed it seems like it does inconsistently: it's sometimes used as the
> "empty blob" and sometimes as an "empty tree".

Git does not use 0*40 to refer to "an empty thing" at all.  It is
used to denote a "missing thing".  A change to _create_ a new file
and a diff to _modify_ an existing empty file are conceptually two
different things, and are shown differently.

It would be incorrect to say "it used to be an empty blob" by using
e69de29bb2d1d on the left hand side of a patch that creates a new
file.