git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Blob hash of binary files in patches generated by git format patch show in full form instead of short form
Date: Sun, 21 Mar 2021 10:31:26 -0700	[thread overview]
Message-ID: <xmqqblbcbehd.fsf@gitster.g> (raw)
In-Reply-To: <499c9922-eb42-c2a8-b4b4-8e5197ea0fc6@gmail.com> (Bagas Sanjaya's message of "Sun, 21 Mar 2021 20:05:39 +0700")

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.

  reply	other threads:[~2021-03-21 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 13:05 Blob hash of binary files in patches generated by git format patch show in full form instead of short form Bagas Sanjaya
2021-03-21 17:31 ` Junio C Hamano [this message]
2021-03-22  5:47   ` Bagas Sanjaya
2021-03-22 10:06     ` Bagas Sanjaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqblbcbehd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).