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

Re: git am oddity

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Mar 31, 2014, 22:38 UTC
Message-ID
<CAGdFq_hM11bqhPsJqmx6x9wA-KcHvA=RJU+wQWWEuEQR1EU8GQ@mail.gmail.com>
In-Reply-To
<xmqqbnwm2ex1.fsf@gitster.dls.corp.google.com>
On Mon, Mar 31, 2014 at 3:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> As you are doing -3 (not the -p3), it would have:
>
>  * noticed that the patch is trying to update "baz/file";
>
>  * noticed that there is no "baz/file" but it could salvage the
>    patch by doing a three-way merge, in case that the patch was
>    prepared against a tree that moved path "foo/bar/baz" to "baz";
>    and
>
>  * such a three-way merge succeeds cleanly for a path whose movement
>    was detected correctly.
>
> So it does not look odd at all to me (the use of "-p 3" does look
> odd, but I know this is an effort to come up with a minimum example,
> so it is understandable that it may look contribed ;-).

Ah, we were thinking that 'git am' (when run from a subdirectory), would apply the patches "from the current directory". So the right solution was to instead do:

$  git am --directory=foo/bar/baz -p 3 0001-my-test.patch
Thank you,
-- 
Cheers,

Sverre Rabbelier
Previous: Junio C Hamano
Message 3 of 3 in “git am oddity”
  1. Sverre RabbelierMar 31, 2014
  2. Junio C HamanoMar 31, 2014
  3. Sverre RabbelierMar 31, 2014

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.