Message ID | 499c9922-eb42-c2a8-b4b4-8e5197ea0fc6@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8925eff9038497d2b6c45489e14dde945e32d96d |
Headers | show |
Series | Blob hash of binary files in patches generated by git format patch show in full form instead of short form | expand |
Bagas Sanjaya <bagasdotme@gmail.com> 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.
On 22/03/21 00.31, Junio C Hamano wrote: > Bagas Sanjaya <bagasdotme@gmail.com> 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. > Hmm... but I don't see that in the documentation for git format-patch. Maybe I need to send doc update.
Oh oh oh, I see git diff format for generating patches in documentation for git diff-files. On 22/03/21 12.47, Bagas Sanjaya wrote: > On 22/03/21 00.31, Junio C Hamano wrote: >> Bagas Sanjaya <bagasdotme@gmail.com> 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. >> > > Hmm... but I don't see that in the documentation for git format-patch. > Maybe I need to send doc update. >
diff --git a/stackoverflow.png b/stackoverflow.png new file mode 100644 index 0000000000000000000000000000000000000000..969908ad3161a66af31f2441cfea4ae002a5ec67 ``` while diff header for alt description read: ``` diff --git a/stackoverflow.alt b/stackoverflow.alt new file mode 100644 index 0000000..9368417 ``` Similarly, for the second patch (INTM poster), diff header for the image read: ``` diff --git a/idntm.jpg b/idntm.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8921ab9540e0a36a53f8c6632482fb04d5d0cc6c ``` while diff header for alt description read: ``` diff --git a/idntm.alt b/idntm.alt new file mode 100644 index 0000000..719feb9