Skip to contentSkip to conversation

patman: Don't barf if the word 'commit' starts a line

PATCH New Doug Anderson 2 participants 2 messages Mar 1, 2013 – Mar 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: Don't barf if the word 'commit' starts a line

Patman's regular expression for detecting the start of a commit in a git log was a little simplistic and could be confused if the git log itself had the word "commit" as the start of a line (as this commit does). Make patman a little more robust.

---
 tools/patman/patchstream.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/patman/patchstream.py +1 -1
index f7ee75a..cf12362 100644
@@ -49,7 +49,7 @@ re_series = re.compile('^Series-(\w*): *(.*)')
 re_tag = re.compile('^(Tested-by|Acked-by|Cc): (.*)')
 
 # The start of a new commit in the git log
-re_commit = re.compile('^commit (.*)')
+re_commit = re.compile('^commit ([0-9a-f]*)$')
 
 # We detect these since checkpatch doesn't always do it
 re_space_before_tab = re.compile('^[+].* \t')
Signature · 1 line
1.8.1.3
#1 lore raw

PATCH 1/1 patman: Don't barf if the word 'commit' starts a line

Hi Doug,

Quoted 7 lines · Doug Anderson

Patman's regular expression for detecting the start of a commit in a git log was a little simplistic and could be confused if the git log itself had the word "commit" as the start of a line (as this commit does). Make patman a little more robust.

Thanks - that bugged me too.

Regards,
Simon

Quoted 20 lines
---
 tools/patman/patchstream.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/patman/patchstream.py +1 -2
index f7ee75a..cf12362 100644
@@ -49,7 +49,7 @@ re_series = re.compile('^Series-(\w*): *(.*)')
 re_tag = re.compile('^(Tested-by|Acked-by|Cc): (.*)')
 
 # The start of a new commit in the git log
-re_commit = re.compile('^commit (.*)')
+re_commit = re.compile('^commit ([0-9a-f]*)$')
 
 # We detect these since checkpatch doesn't always do it
 re_space_before_tab = re.compile('^[+].* \t')
--

1.8.1.3