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

Re: git-am doesn't apply the rest of the email after a partial patch fail?

From
CMConstantine A. Murenin <mureninc@gmail.com>
Date
Apr 9, 2013, 18:34 UTC
Message-ID
<CAPKkNb6tbGtcpiYGpj6mSPnp_-aXO=HTvAjOEKJ1f-cgPOHBDA@mail.gmail.com>
In-Reply-To
<7vppy4ykse.fsf@alter.siamese.dyndns.org>
On 8 April 2013 10:49, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> "Constantine A. Murenin" <mureninc@gmail.com> writes:
>
>> However, what I've faced with, is that when a conflict happens, and I
>> resolve, and do `git add`, and `git am --resolved`, then the rest of
>> the `format-patch` email where the conflict has occurred is discarded,
>
> That is unusual.  Are you using any other options when running "git
> am"?  You said `git add`, but what did you add?
>
> By default, its patch application is all-or-none, so when it stops,
> saying "I cannot apply this patch---please help me with it", it
> expects that all the changes the email wanted to give you has been
> applied by you to your working tree, perhaps using GNU patch or "git
> apply --reject", followed by manual editing, and to your index using
> "git add", when you run "git am --resolved".  Not just the file (or
> hunk) it detected issues with.

Well, I now know this, but it wasn't clear from the documentation that that was the behaviour.

Also, I've now noticed that "--reject" doesn't automatically do `git add` of any new files that were added, so, once you resolve the conflicts, and add those files that used to result in a conflict, you're still missing out.

C.
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “git-am doesn't apply the rest of the email after a partial patch fail?”
  1. Constantine A. MureninApr 7, 2013
  2. Constantine A. MureninApr 7, 2013
  3. Junio C HamanoApr 8, 2013
  4. Constantine A. MureninApr 9, 2013
  5. Junio C HamanoApr 9, 2013

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.