bug-patch
[Top][All Lists]
Advanced

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

Re: [bug-patch] [PATCH] Add regression test for binary file deletion


From: Dmitry V. Levin
Subject: Re: [bug-patch] [PATCH] Add regression test for binary file deletion
Date: Mon, 24 Sep 2012 20:56:52 +0400

On Mon, Sep 24, 2012 at 06:44:26PM +0200, Andreas Grünbacher wrote:
> Hmm,
> 
> this is an interesting case; thanks for the report.
> 
> With a text file, the patch contains the contents of the file to
> delete, and we can recreate it by reverse applying the patch.  With
> this patch, we cannot.  Right now, patch fails and gives this error
> message:
> 
>   patching file target
>   File target is not empty after patch, as expected
> 
> All previous releases of patch didn't recognize this as a diff at all.
>  If a binary diff is used instead, patch rejects it with:
> 
>   File target: git binary diffs are not supported.
> 
> Git deletes binary files when passed a binary diff (git diff
> --binary), but it rejects this patch with:
> 
>   error: cannot apply binary patch to 'target' without full index line
>   error: target: patch does not apply
> 
> This seems to confirm that patch's current behavior makes sense; the
> error message could be better though.
> 
> What do you think?

I agree the new behavior looks safer than in patch-2.7 where it was
inconsistent: the binary target was deleted, the exit status was 0, but
there was the same misleading error message that "File target is not empty
after patch, as expected".  The error message definitely could be better.


-- 
ldv

Attachment: pgp3NbsezqeQe.pgp
Description: PGP signature


reply via email to

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