[U-Boot] [PATCH 0/4] 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(-)

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 ilya.yanok@cogentembedded.com --- tools/patman/patchstream.py | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index be40af3..036b129 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -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

Dear Ilya Yanok,
In message 1344332768-11891-2-git-send-email-ilya.yanok@cogentembedded.com you wrote:
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 ilya.yanok@cogentembedded.com
tools/patman/patchstream.py | 6 ++++++ 1 file changed, 6 insertions(+)
Applied, thanks.
Best regards,
Wolfgang Denk

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 ilya.yanok@cogentembedded.com --- tools/patman/patchstream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 036b129..3de32d5 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -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

Dear Ilya Yanok,
In message 1344332768-11891-3-git-send-email-ilya.yanok@cogentembedded.com you wrote:
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 ilya.yanok@cogentembedded.com
tools/patman/patchstream.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks.
Best regards,
Wolfgang Denk

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 ilya.yanok@cogentembedded.com --- tools/patman/series.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/patman/series.py b/tools/patman/series.py index 05d9e73..4e7cb71 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -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

Dear Ilya Yanok,
In message 1344332768-11891-4-git-send-email-ilya.yanok@cogentembedded.com you wrote:
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 ilya.yanok@cogentembedded.com
tools/patman/series.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

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.
Signed-off-by: Ilya Yanok ilya.yanok@cogentembedded.com --- tools/patman/patchstream.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 3de32d5..0503bac 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -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

Dear Ilya Yanok,
In message 1344332768-11891-5-git-send-email-ilya.yanok@cogentembedded.com you wrote:
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.
Signed-off-by: Ilya Yanok ilya.yanok@cogentembedded.com
tools/patman/patchstream.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

Hi,
On Tue, Aug 7, 2012 at 2:46 AM, Ilya Yanok ilya.yanok@cogentembedded.com wrote:
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
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(-)
-- 1.7.9.5
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (3)
-
Ilya Yanok
-
Simon Glass
-
Wolfgang Denk