git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] how to diff one blob with nothing
@ 2023-07-19  9:59 ZheNing Hu
  2023-07-19 16:15 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: ZheNing Hu @ 2023-07-19  9:59 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

Hi,

I want to diff two blobs right now, and one of them
may be empty, so I tried using
0000000000000000000000000000000000000000 or
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (empty blobID)
to test its effect, and the result I found was:

git diff 00750edc07d6415dcc07ae0351e9397b0222b7ba
0000000000000000000000000000000000000000
fatal: bad object 0000000000000000000000000000000000000000

git diff 00750edc07d6415dcc07ae0351e9397b0222b7ba
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
fatal: bad object e69de29bb2d1d6434b8b29ae775ad8c2e48c5391

Since the "empty object" has not been created, the
git diff operation fails.

There may be some other methods [1] available to diff
two blobs by creating an empty blob, but I don't want to
create this empty blob, are there any other ways to solve
this problem?

[1]: https://stackoverflow.com/questions/14564034/creating-a-git-diff-from-nothing

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-05  8:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19  9:59 [QUESTION] how to diff one blob with nothing ZheNing Hu
2023-07-19 16:15 ` Junio C Hamano
2023-07-26 18:00   ` ZheNing Hu
2023-07-26 18:23     ` Junio C Hamano
2023-07-27 17:46       ` Taylor Blau
2023-07-28  3:40         ` ZheNing Hu
2023-08-03  5:16           ` ZheNing Hu
2023-08-03 15:24             ` Taylor Blau
2023-08-04  2:28               ` ZheNing Hu
2023-08-04  8:28                 ` Christian Couder
2023-08-04 18:34                   ` Taylor Blau
2023-08-04 19:00                     ` Junio C Hamano
2023-08-05  8:27                       ` ZheNing Hu
2023-07-27 17:13     ` Konstantin Khomoutov
2023-07-28  3:35       ` ZheNing Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).