bug-patch
[Top][All Lists]
Advanced

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

Re: [bug-patch] Incorrect error when applying git-created patch


From: Andreas Grünbacher
Subject: Re: [bug-patch] Incorrect error when applying git-created patch
Date: Mon, 11 Aug 2014 18:58:02 +0200

Tim,

2014-08-11 18:30 GMT+02:00 Tim Waugh <address@hidden>:
> When applying a patch from git that removes a binary file, patch
> complains and gives a non-zero exit code.
>
> [...]
> Because of 'diff --git' and 'deleted file mode', patch rightly thinks
> this patch intends to delete that file. However, it doesn't actually
> delete it because it's a binary file so doesn't see any changes to make.

Right, patch is conservative and only deletes files when the file contents
match what's in the patch. Git does the same:

$ git show | git apply
error: cannot apply binary patch to 'add.png' without full index line
error: add.png: patch does not apply

With a binary patch, it succeeds:

$ git show --binary | git apply

Patch doesn't currently support git binary patches, it only recognizes them.

> Shouldn't it just delete the file in this instance?

The current behavior seems reasonable to me -- better safe than sorry.
The message could be improved though.

What do you think?

Thanks,
Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]