diff mbox

[U-Boot] patman: Don't barf if the word 'commit' starts a line

Message ID 1362172267-3395-1-git-send-email-dianders@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Doug Anderson March 1, 2013, 9:11 p.m. UTC
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.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 tools/patman/patchstream.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass March 3, 2013, 12:47 a.m. UTC | #1
Hi Doug,

On Fri, Mar 1, 2013 at 1:11 PM, Doug Anderson <dianders@chromium.org> wrote:
> 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.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>

Thanks - that bugged me too.

Acked-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

> ---
>  tools/patman/patchstream.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
> index f7ee75a..cf12362 100644
> --- a/tools/patman/patchstream.py
> +++ b/tools/patman/patchstream.py
> @@ -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
>
diff mbox

Patch

diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index f7ee75a..cf12362 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -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')