Re: [PATCH] git-apply: silence errors for success cases
From: Junio C Hamano <hidden>
Date: 2021-04-21 02:14:56
Jerry Zhang [off-list ref] writes:
Certain invocations of "git apply --3way" will print error messages even though git is able to fall back on apply_fragments and apply the patch successfully with a return value of 0. To fix, return early from try_threeway() in the following cases:
I suspect that this is a recent breakage after we swapped the order of 3way fallback. It used to be that we tried the straight application first (while suppressing the error messages) and then fell back on 3way (while fully exposing the error messages). It is understandable if we just swapped the order without changing when errors are squelched, we may leak unnecessary error messages while trying 3way and failing. After having written all of the above, I just realized that the swapping of the order was _your_ topic and you didn't have to be explained any of the above ;-) Just consider it as my thinking aloud for the benefit of those who are reading from the sideline (i.e. those not on the To/Cc list but are reading because this message is sent to git@ mailing list).