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

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

 



Konstantin Khomoutov <kostix@xxxxxxxx> 于2023年7月28日周五 01:13写道:
>
> >> 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.
>
> You could probably just do
>
>   git cat-file -s e69de29bb
>
> to figure out whether a blob is empty.
>
> What is your end goal? Do you indeed want to produce a "trivial patch" which
> merely "adds" all the lines of the blob you'd like to compare to an empty one
> (assuming the blob conains text)?
>

Yes, I need to compare the diff between multiple versions of blobs in real time
(only given the blobID). Once a file is deleted or created, I have to
perform this
comparison with the "empty blob".




[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