From: Bin Meng Date: Mon, 27 Jun 2016 06:24:32 +0000 (-0700) Subject: tools: patman: Handle missing 'END' in non-last commit of a series X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=94fbd3e37d6bdbf5490a185607ca20f862637220;p=u-boot.git tools: patman: Handle missing 'END' in non-last commit of a series The following python error: Traceback (most recent call last): File "./tools/patman/patman", line 144, in series = patchstream.FixPatches(series, args) File "./tools/patman/patchstream.py", line 477, in FixPatches commit = series.commits[count] IndexError: list index out of range is seen when: - 'END' is missing in those tags - those tags are put in the last part in a commit message - the commit is not the last commit of the series Add testing logic to see if a new commit starts. Signed-off-by: Bin Meng Acked-by: Simon Glass --- diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 0612612372..69d5cfb7a8 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -177,9 +177,10 @@ class PatchStream: elif commit_match: self.state = STATE_MSG_HEADER - # If a tag is detected + # If a tag is detected, or a new commit starts if series_tag_match or commit_tag_match or \ - cover_match or cover_cc_match or signoff_match: + cover_match or cover_cc_match or signoff_match or \ + self.state == STATE_MSG_HEADER: # but we are already in a section, this means 'END' is missing # for that section, fix it up. if self.in_section: