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

Re: [PATCH 1/2] am: preliminary support for hg patches

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Aug 30, 2011, 08:28 UTC
Message-ID
<CAOxFTczyNtyLWyXppj=0UW_zeD3t+rDtzt-vwqXkwvWOTdxi2g@mail.gmail.com>
In-Reply-To
<7vd3fo53oe.fsf@alter.siamese.dyndns.org>
On Mon, Aug 29, 2011 at 11:05 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> Nope, it doesn't have index .... lines. Still, the patches seems to
>> apply correctly. Well, the couple of patches I tested did, at least,
>> even though they were marked as diff --git and they were lacking the
>> index ... lines.
>
> Does "am -3" do the right thing when the patch does not apply cleanly, for
> example?

three-way merges are impossible because all hash information is being stripped (hg stores them in the Node ID and Parent metadata, which we strip, and has no index metadata for the actual diff blocks). This is correctly detected by -3, with

Applying: Threeway test
fatal: sha1 information is lacking or useless (dir.h).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Threeway test

The message is a bit misleading (it's not the repo lacking the blobs, it's the patch missing the information), but the process fails as expected.

> What about renaming patches?

They lack similarity indices, but they seem to be properly formated (and the simple cases I tested apply correctly).

In fact, stripping the --git from an hg patch containing a rename makes the patch unusable:

error: datetime.move: does not exist in index Patch failed at 0001 Move

So I think that keeping the --git is the right choice.
-- 
Giuseppe "Oblomov" Bilotta
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 9 in “am: foreign patch support fixes”
  1. 0/2 am: foreign patch support fixesGiuseppe Bilotta, Aug 29, 2011
  2. 1/2 am: preliminary support for hg patchesGiuseppe Bilotta, Aug 29, 2011
  3. Junio C HamanoAug 29, 2011
  4. Giuseppe BilottaAug 29, 2011
  5. Junio C HamanoAug 29, 2011
  6. Giuseppe BilottaAug 30, 2011
  7. Junio C HamanoAug 30, 2011
  8. Sverre RabbelierAug 31, 2011
  9. 2/2 am: fix stgit patch manglingGiuseppe Bilotta, Aug 29, 2011

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.