Re: Why is there a --binary option needed for git-apply?

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

 



Carl Worth <cworth@xxxxxxxxxx> 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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]