Patchwork [Bug,5836] New: import of a git patch containing 'From' in the commit message confuses Mercurial

login
register
mail settings
Submitter mercurial-bugs@mercurial-scm.org
Date April 10, 2018, 3:13 p.m.
Message ID <bug-5836-285@https.bz.mercurial-scm.org/>
Download mbox | patch
Permalink /patch/30631/
State Not Applicable
Headers show

Comments

mercurial-bugs@mercurial-scm.org - April 10, 2018, 3:13 p.m.
https://bz.mercurial-scm.org/show_bug.cgi?id=5836

            Bug ID: 5836
           Summary: import of a git patch containing 'From' in the commit
                    message confuses Mercurial
           Product: Mercurial
           Version: 4.5
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla@mercurial-scm.org
          Reporter: patrickdepinguin+mercurial@gmail.com
                CC: mercurial-devel@mercurial-scm.org

hg import of the following patch:

From 28dd2f2896bff7b861a4272fa343e3f7fa80725c Mon Sep 17 00:00:00 2001
From: Foo Bar <foo@example.com>
Date: Thu, 29 Mar 2018 16:15:15 +0200
Subject: foobar

From the release notes

Foo bar baz



I.e. the 'From the release notes' line is seemingly interpreted as a 'From'
header of the email and lost in the final commit.
The author of the original commit is lost, and ui.username is used instead.

It looks as if somewhere a check on 'From' should become a check on 'From:'.

Patch

diff --git a/foo b/foo
index 812dfbe320..60498db8e4 100644
--- a/foo
+++ b/foo
@@ -1,1 +1,1 @@ 
-foo
+bar


confuses Mercurial.
The end result after applying the patch (hg export) is:

# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
# Date 1523372729 -7200
#      Tue Apr 10 17:05:29 2018 +0200
# Node ID 37ded973b713448442ef8f5a13ce588d2367bf28
# Parent  4eeb05b4d2752b37383f18560e6535c4df2df9b1
Foo bar baz

diff --git a/foo b/foo
--- a/foo
+++ b/foo
@@ -1,1 +1,1 @@ 
-foo
+bar