Re: [BUG] git-am silently applying patches incorrectly

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

 



Alexander Miseler <alexander@xxxxxxxxxx> writes:

> .... On a side note: if this problem is tackled it might be
> sensible to add a heuristic to git format-patch that increases the
> context size for hunks that are likely to be ambiguous.

In general that approach would not help.  Imagine a case where the
problematic patch from David Henningsson were only about moving the
calling site of check_required() within the element_probe() function.
IOW, imagine that the hunk starting at line 1018 to modify
check_required() itself weren't involved in his change.

Before or after such a change, there would be only one location that
closes two blocks followed by a blank line and return 0 at the end of the
function, which is the necessary context of the "moved after" hunk of the
patch, so when producing the patch, there is no way for format-patch to
notice that it is likely to become ambiguous.

But if the change to check_required() were applied as a separate patch
before the change to move the call site was applied, at the application
time, the patch becomes ambiguous.

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