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

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

 



On Fri, Aug 4, 2023 at 6:42 AM ZheNing Hu <adlternative@xxxxxxxxx> wrote:

> Actually, there is no need to support a default empty blob.
> For example, with the command "git diff --no-index <file> /dev/null",
> it can compare a file with /dev/null, but it can only compare <file>
> and not <oid>.
> Therefore, using commands like "git diff <oid> /dev/null",
> "git diff --no-index <oid> /dev/null", or even "git diff <oid> --stdin"
> could potentially solve this issue.

Maybe it would be clearer to have a new option, called for example
"--blob-vs-file", for that then. It could support both:

$ git diff --blob-vs-file <blob> <file>

and:

$ git diff --blob-vs-file <file> <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