git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Carl Worth <cworth@cworth.org>
Cc: git@vger.kernel.org
Subject: Re: Why is there a --binary option needed for git-apply?
Date: Tue, 5 Sep 2006 23:38:03 -0400	[thread overview]
Message-ID: <20060906033803.GA30598@spearce.org> (raw)
In-Reply-To: <874pvmxikq.wl%cworth@cworth.org>

Carl Worth <cworth@cworth.org> wrote:
> Shawn Pearce was kind enough to direct me to the --binary option for
> git-apply which solved my problem. But that left me wondering why
> git-apply requires this extra command-line option to do its
> job. Shouldn't git-apply simply apply the patch it is given?
> 
> If there is some reason for git-apply to only apply binary patches
> when under the duress of --binary, then at the very least it could use
> a better error message explaining the situation.

I see no reason why git-apply shouldn't always have --binary enabled.
If the patch contains full pre-image/post-image blob IDs and we have
an exact match against the pre-image and we have the post-image
in our tree it should just apply even if the user didn't supply
--binary.  If the patch contains a binary delta and we have an
exact match against the pre-image it should also just apply.

But if there's a binary hunk and we lack the full pre/post image blob
IDs, we lack the post image and there's no detla, or the pre-image
doesn't exactly match then we should obviously still abort with a
reasonable error message as there's no sane course of action to take.

-- 
Shawn.

  reply	other threads:[~2006-09-06 10:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-05 18:40 Why is there a --binary option needed for git-apply? Carl Worth
2006-09-06  3:38 ` Shawn Pearce [this message]
2006-09-07  6:45 ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=20060906033803.GA30598@spearce.org \
    --to=spearce@spearce.org \
    --cc=cworth@cworth.org \
    --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.
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 NNTP newsgroup(s).