Some patman fixes
cover Some patman fixes
Patman is the great tool but I've found it nearly unusable for me. First of all I need to work with multiple signoffs in commits, then I'd like to use multiline changelog entries and I accostomed to putting changelog enties to the bottom of the commit.
These patches fix changelog processing and disables additional signoff and changelog processing.
Ilya Yanok (4):
patman: fix end of changes detection
patman: don't pick changes while processing patches
patman: don't mess with changelog
patman: don't mess with signoffs
tools/patman/patchstream.py | 22 ++++++++++------------ tools/patman/series.py | 5 ++--- 2 files changed, 12 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/4 patman: fix end of changes detection
Changes may end in '---' line or Signoff line (generated by git format-patch) in case of Series-changes: lines being the last ones in commit message. So detect it properly.
--- tools/patman/patchstream.py | 6 ++++++ 1 file changed, 6 insertions(+)
tools/patman/patchstream.py +6 -0
@@ -36,6 +36,9 @@ re_remove = re.compile('^BUG=|^TEST=|^Change-Id:|^Review URL:' # Lines which are allowed after a TEST= line re_allowed_after_test = re.compile('^Signed-off-by:') +# Signoffs +re_signoff = re.compile('^Signed-off-by:') + # The start of the cover letter re_cover = re.compile('^Cover-letter:')
@@ -207,6 +210,9 @@ class PatchStream: if is_blank: # Blank line ends this change list self.in_change = 0 + elif line == '---' or re_signoff.match(line): + self.in_change = 0 + out = self.ProcessLine(line) else: self.series.AddChange(self.in_change, self.commit, line) self.skip_blank = False
Signature · 1 line
1.7.9.5
Wolfgang Denk
AppliedPATCH 1/4 patman: fix end of changes detection
Dear Ilya Yanok,
Quoted 8 lines · In message <[email protected]>…
Changes may end in '---' line or Signoff line (generated by git format-patch) in case of Series-changes: lines being the last ones in commit message. So detect it properly.
Signed-off-by Ilya Yanok <[email protected]>--- tools/patman/patchstream.py | 6 ++++++ 1 file changed, 6 insertions(+)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The more we disagree, the more chance there is that at least one of us is right.
PATCH 2/4 patman: don't pick changes while processing patches
In reply to Ilya YanokWe already got all changes from git log output and the comment to the ProcessLine function clearly states that 'patch' mode is not for scanning tags.
--- tools/patman/patchstream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/patman/patchstream.py +2 -1
@@ -214,7 +214,8 @@ class PatchStream: self.in_change = 0 out = self.ProcessLine(line) else: - self.series.AddChange(self.in_change, self.commit, line) + if self.is_log: + self.series.AddChange(self.in_change, self.commit, line) self.skip_blank = False # Detect Series-xxx tags
Signature · 1 line
1.7.9.5
Wolfgang Denk
AppliedPATCH 2/4 patman: don't pick changes while processing patches
Dear Ilya Yanok,
Quoted 8 lines · In message <[email protected]>…
We already got all changes from git log output and the comment to the ProcessLine function clearly states that 'patch' mode is not for scanning tags.
Signed-off-by Ilya Yanok <[email protected]>--- tools/patman/patchstream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The only way you could make a happy marriage is by cuttin' their heads off as soon as they say `I do', yes? You can't make happi- ness... - Terry Pratchett, _Witches Abroad_
PATCH 3/4 patman: don't mess with changelog
In reply to Ilya YanokDon't try to sort and uniq changelog entries as this breaks multiline entries. It will be better to add some real multi-line support but for now just preserve the entries as is.
--- tools/patman/series.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/patman/series.py +2 -3
@@ -154,10 +154,9 @@ class Series(dict): for this_commit, text in self.changes[change]: if commit and this_commit != commit: continue - if text not in out: - out.append(text) + out.append(text) if out: - out = ['Changes in v%d:' % change] + sorted(out) + out = ['Changes in v%d:' % change] + out if need_blank: out = [''] + out final += out
Signature · 1 line
1.7.9.5
Wolfgang Denk
AppliedPATCH 3/4 patman: don't mess with changelog
Dear Ilya Yanok,
Quoted 8 lines · In message <[email protected]>…
Don't try to sort and uniq changelog entries as this breaks multiline entries. It will be better to add some real multi-line support but for now just preserve the entries as is.
Signed-off-by Ilya Yanok <[email protected]>--- tools/patman/series.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All this doesn't alter anything, you know. The world is still full of stupid people. They don't use their brains. They don't seem to want to think straight. - Terry Pratchett, _Soul Music_
PATCH 4/4 patman: don't mess with signoffs
In reply to Ilya YanokCurrently patman assumes that there should be only one Signoff line and this is obviously incorrect: we often have to work with patches containing other people signoffs. Moreover, it's really desirable to preserve the comments between signoffs.
So until some sophisticated signoff processing will be developed I suggest just don't mess with signoffs at all and treat them like plain text lines. The only drawback I've found so far is the case where you have a patch with someones else signoff but not yours and also have to patman tags under signoff line. In this case you will get extra empty line between signoffs.
--- tools/patman/patchstream.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
tools/patman/patchstream.py +2 -11
@@ -46,7 +46,7 @@ re_cover = re.compile('^Cover-letter:') re_series = re.compile('^Series-(\w*): *(.*)') # Commit tags that we want to collect and keep -re_tag = re.compile('^(Tested-by|Acked-by|Signed-off-by|Cc): (.*)') +re_tag = re.compile('^(Tested-by|Acked-by|Cc): (.*)') # The start of a new commit in the git log re_commit = re.compile('^commit (.*)')
@@ -241,15 +241,8 @@ class PatchStream: # Detect tags in the commit message elif tag_match: - # Onlly allow a single signoff tag - if tag_match.group(1) == 'Signed-off-by': - if self.signoff: - self.warn.append('Patch has more than one Signed-off-by ' - 'tag') - self.signoff += [line] - # Remove Tested-by self, since few will take much notice - elif (tag_match.group(1) == 'Tested-by' and + if (tag_match.group(1) == 'Tested-by' and tag_match.group(2).find(os.getenv('USER') + '@') != -1): self.warn.append("Ignoring %s" % line) elif tag_match.group(1) == 'Cc':
@@ -288,8 +281,6 @@ class PatchStream: # Output the tags (signeoff first), then change list out = [] - if self.signoff: - out += self.signoff log = self.series.MakeChangeLog(self.commit) out += self.FormatTags(self.tags) out += [line] + log
Signature · 1 line
1.7.9.5
Wolfgang Denk
AppliedPATCH 4/4 patman: don't mess with signoffs
Dear Ilya Yanok,
Quoted 12 lines · In message <[email protected]>…
Currently patman assumes that there should be only one Signoff line and this is obviously incorrect: we often have to work with patches containing other people signoffs. Moreover, it's really desirable to preserve the comments between signoffs.
So until some sophisticated signoff processing will be developed I suggest just don't mess with signoffs at all and treat them like plain text lines. The only drawback I've found so far is the case where you have a patch with someones else signoff but not yours and also have to patman tags under signoff line. In this case you will get extra empty line between signoffs.
Quoted 4 lines
Signed-off-by Ilya Yanok <[email protected]>--- tools/patman/patchstream.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Evil does seek to maintain power by suppressing the truth." "Or by misleading the innocent." -- Spock and McCoy, "And The Children Shall Lead", stardate 5029.5.
cover Some patman fixes
In reply to Ilya YanokHi,
Quoted 5 lines · Ilya Yanok
Patman is the great tool but I've found it nearly unusable for me. First of all I need to work with multiple signoffs in commits, then I'd like to use multiline changelog entries and I accostomed to putting changelog enties to the bottom of the commit.
I do wonder whether there should at least be options to sort/uniq entries and use the 'one line' format. I try to keep the changelog to a single line for each thing I change, and the merging that happens in the cover letter is useful, I think.
Regards,
Simon
Quoted 21 lines
These patches fix changelog processing and disables additional signoff and changelog processing.
Ilya Yanok (4):
patman: fix end of changes detection
patman: don't pick changes while processing patches
patman: don't mess with changelog
patman: don't mess with signoffstools/patman/patchstream.py | 22 ++++++++++------------ tools/patman/series.py | 5 ++--- 2 files changed, 12 insertions(+), 15 deletions(-)--
1.7.9.5_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot