Re: [QUESTION] how to diff one blob with nothing

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

 



ZheNing Hu <adlternative@xxxxxxxxx> writes:

>> If you haven't created one, of course it would fail.  It should help
>> to do
>>
>>     $ git hash-object -w --stdin </dev/null
>>
>> before running
>>
>>     $ git diff 00750edc e69de29bb
>>
>
> This is a viable solution, but it's a bit ugly since a read-only "diff"
> requires ”write“ an empty blob.

If you do not even have an empty blob, you have no business
comparing some other blobs you have with it, do you?

If you do not have a file with a single line "hello, world\n" (that
hashes to 4b5fa63702dd96796042e92787f464e28f09f17d if written in a
blob), then you cannot do "git diff 4b5fa637" with anything and
expect it to work.  It is the same thing.

Besides, if you _know_ you want to compare a blob X to emptyness,
you are better of doing "git cat-file blob X" in the first place.




[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]

  Powered by Linux