[oe-commits] [openembedded-core] 11/26: lib/oe/patch: exclude "From <hash>" from commit message when PATCHTOOL is "git"

git at git.openembedded.org git at git.openembedded.org
Fri Sep 23 17:06:53 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 19a6b18ac23cb2d7bb89203f774b2bee7f0cb03c
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Fri Sep 23 21:22:10 2016 +1200

    lib/oe/patch: exclude "From <hash>" from commit message when PATCHTOOL is "git"
    
    If you leave "From <hash>" lines in the commit message it can actually
    break git rebase because it tries to interpret the line in the context
    of the current repository, and if the hash is invalid then a rebase
    will blow up with:
    
      fatal: git cat-file: could not get object info
    
    or in newer git versions:
    
      error: unable to find <hash>
      fatal: git cat-file <hash>: bad file
    
    (I hit this when I tried to do a devtool upgrade on openssl to 1.0.2i
    the first time I did "git rebase --skip")
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/patch.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 05e0faa..c04f098 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -317,6 +317,7 @@ class GitApplyTree(PatchTree):
     def interpretPatchHeader(headerlines):
         import re
         author_re = re.compile('[\S ]+ <\S+@\S+\.\S+>')
+        from_commit_re = re.compile('^From [a-z0-9]{40} .*')
         outlines = []
         author = None
         date = None
@@ -346,6 +347,9 @@ class GitApplyTree(PatchTree):
                 # git is fussy about author formatting i.e. it must be Name <email at domain>
                 if author_re.match(authorval):
                     author = authorval
+            elif from_commit_re.match(line):
+                # We don't want the From <commit> line - if it's present it will break rebasing
+                continue
             outlines.append(line)
         return outlines, author, date, subject
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list