summaryrefslogtreecommitdiff
path: root/t/t5100/msg0005
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-04-09 16:58:28 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-04-14 11:20:27 -0700
commit0ba17dd0229582481d048388024741cfef3298a3 (patch)
tree039295f916c32d27e1e7489414c990d319dbf318 /t/t5100/msg0005
parentam: suppress apply errors when using 3-way (diff)
downloadtgif-0ba17dd0229582481d048388024741cfef3298a3.tar.xz
am -3: recover the diagnostic messages for corrupt patches
"git am -3" first tries to apply the patch without any extra trick, and applies it to a synthesized tree for 3-way merge after the first attempt fails. "git apply" exits with status 1 for a patch that is well-formed but is not applicable (and it dies on other errors with non-zereo, non-1 status) and has an optimization to fall back to the 3-way merge only in the case. An earlier patch 3ddd170 (am: suppress apply errors when using 3-way, 2009-06-16) squelched diagnostic messages from the first attempt, not to be shown to the end user. This worked reasonably well if the reason the first application failed was because the patch was made against a wrong version. When the patch is corrupt (e.g. line-wrapped or leading whitespaces got dropped), however, because the second patch application is not even attempted, the error message from the first application is never shown and is forever lost. This message is necessary to locate where the patch is corrupt and fix it up. We could fix this issue by reverting 3dd170, or keeping the error message to somewhere and showing it, but because this is an error codepath, the easiest is to disable the optimization. The second patch application is attempted even when the input is corrupt, and it will notice, diagnose, and stop with an error message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5100/msg0005')
0 files changed, 0 insertions, 0 deletions