Subject: Re: Blob hash of binary files in patches generated by git format patch show in full form instead of short form

From: Junio C Hamano <[email-masked]>
Date: Sun, 21 Mar 2021 10:31:26 -0700

Bagas Sanjaya <[email-masked]> writes:

> What's different between what you expected and what actually happened?
>
> Blob hash for binary files are shown in full form, as opposed to blob hash
> for text files.

This is working as intended, designed and implemented.  

The textual patch is meant to be applicable on target text that may
even have been slightly modified from the original from which the
patch was taken, and the abbreviated object name on the "index" line
is there mostly for human's sanity check and as a visual aid.
Ordinarily it is not used to actually find the matching blob object
(and it is not an error if there is no matching blob object in the
repository that a patch application is attempted in).

But the binary patch is designed to be applicable only to an exact
copy of the original and nowhere else.  The object name is given in
full, instead of using abbreviated form, to ensure that we do not
try to apply a binary patch to an object whose name is "similar".

Thanks.