Re: Can't diff against the 00000000 revision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> I currently work around the problem by adding a dummy empty branch, but
>> being able to use the revision 00000000 as a known reference to an empty
>> tree would come in really handy, and since it's already used at various
>> places in Git (post-receive hook and "git show" output, at least), it
>> would seem like a natural extension.

> The empty tree also has a name:
>
>   $ git hash-object -t tree /dev/null
>   4b825dc642cb6eb9a060e54bf8d69288fbee4904

Yay!

   git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904..d59cfff346c3e210adc26501f8cebf8da5ab2e7d

seems to give me the expected diff.
Thanks!

> 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".


        Stefan

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]