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

Re: [PATCH] am: add --check option

From
Johannes Sixt <j6t@kdbg.org>
Date
Jun 4, 2019, 05:58 UTC
Message-ID
<c1dec466-55ca-8543-8f4e-b5daf1e0eab6@kdbg.org>
In-Reply-To
<BUKFSM2OTJUH.38N6DGWH9KX7H@homura>
Am 04.06.19 um 00:00 schrieb Drew DeVault:
Show 18 quoted lines
> On Mon Jun 3, 2019 at 11:09 PM Johannes Sixt wrote:
>> I have to wonder how --check works when 'am' applies multiple patches.
>>
>> When the second patch in a patch series depends on that the first patch
>> is fully applied, what does --check do? Without the first patch applied,
>> then a naive check of the second patch will certainly fail, doesn't it?
> 
> Yeah, this was being discussed in another thread. It'll fail if the
> second patch relies on changes from the first. Open to suggestions on
> how to improve that, but I think it can be improved in a later patch.
> One solution would be to apply all of the patches and then roll back the
> head, but that would dirty the reflog and wouldn't work on a read-only
> filesystem (which it ought to, imo). We can't just say bugger this for a
> lark and ask people to use git-apply, because git-apply chokes on the
> typical email which isn't in the one specific format git-apply wants to
> see (git-am massages emails into that format before sending them to
> git-apply).
> 

You can 'git apply --cached' the patches on a temporary index. This works as long as no merge is necessary, because that would require a worktree.

-- Hannes
Next: Johannes Schindelin
Message 1 of 3 in “Re: [PATCH] am: add --check option”
  1. Johannes SixtJun 4, 2019
  2. Johannes SchindelinJun 4, 2019
  3. Christian CouderJun 4, 2019

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.