git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-apply: silence errors for success cases

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2021, 02:14 UTC
Message-ID
<xmqqtuo0z8mc.fsf@gitster.g>
In-Reply-To
<20210421004733.22395-1-jerry@skydio.com>
Jerry Zhang <jerry@skydio.com> writes:
Show 6 quoted lines
> 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).

Previous: Jerry ZhangNext: Junio C Hamano
Message 2 of 5 in “git-apply: silence errors for success cases”
  1. git-apply: silence errors for success casesJerry Zhang, Apr 21, 2021
  2. Junio C HamanoApr 21, 2021
  3. Junio C HamanoApr 21, 2021
  4. git-apply: silence errors for success casesJerry Zhang, Jul 28, 2021
  5. Jerry ZhangDec 11, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.