patman: A fix and some new tags
cover patman: A fix and some new tags
This series has a fix along with a couple of convenient tags.
Sean Anderson (3):
patman: Fix tests if add_maintainers is set to False
patman: Add Commit-cc as an alias for Patch-cc
patman: Add a tag for when a patch gets added to a series
tools/patman/func_test.py | 10 ++++++++-- tools/patman/patchstream.py | 7 +++++++ tools/patman/patman.rst | 15 ++++++++++++++- ...cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 2 ++ tools/patman/test/test01.txt | 2 ++ 5 files changed, 33 insertions(+), 3 deletions(-)
Signature · 1 line
2.37.1
PATCH 1/3 patman: Fix tests if add_maintainers is set to False
If add_maintainers is set to False in the user's ~/.patman config, it will cause the custom_get_maintainer_script to fail since that test expects maintainers to be added. Set add_maintainer to True in the .patman config to prevent this.
---
tools/patman/func_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/patman/func_test.py +2 -1
@@ -540,7 +540,8 @@ complicated as possible''') with open('.patman', 'w', buffering=1) as f: f.write('[settings]\n' 'get_maintainer_script: dummy-script.sh\n' - 'check_patch: False\n') + 'check_patch: False\n' + 'add_maintainers: True\n') with open('dummy-script.sh', 'w', buffering=1) as f: f.write('#!/usr/bin/env python\n' 'print("[email protected]")\n')
Signature · 1 line
2.37.1
Re: [PATCH 1/3] patman: Fix tests if add_maintainers is set to False
Quoted 6 lines · Sean Anderson
If
add_maintainersis set to False in the user's ~/.patman config, it will cause thecustom_get_maintainer_scriptto fail since that test expects maintainers to be added. Setadd_maintainerto True in the .patman config to prevent this.
Quoted 6 lines
Fixes 8c042fb7f9f ("patman: add '--get-maintainer-script' argument")Signed-off-by Sean Anderson <[email protected]>---
tools/patman/func_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Simon Glass
Reviewed-byRe: [PATCH 1/3] patman: Fix tests if add_maintainers is set to False
Quoted 6 lines · Sean Anderson
If
add_maintainersis set to False in the user's ~/.patman config, it will cause thecustom_get_maintainer_scriptto fail since that test expects maintainers to be added. Setadd_maintainerto True in the .patman config to prevent this.
Quoted 6 lines
Fixes 8c042fb7f9f ("patman: add '--get-maintainer-script' argument")Signed-off-by Sean Anderson <[email protected]>---
tools/patman/func_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH 2/3 patman: Add Commit-cc as an alias for Patch-cc
In reply to Sean AndersonMost tags referring to commits (or patches) are named Commit-something. The exception is Patch-cc. Add a Commit-cc alias so we can use whichever one is convenient.
---
tools/patman/func_test.py | 5 ++++- tools/patman/patchstream.py | 2 ++ tools/patman/patman.rst | 2 +- ...dt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 9 insertions(+), 2 deletions(-)
tools/patman/func_test.py +4 -1
@@ -211,6 +211,7 @@ class TestFunctional(unittest.TestCase): 'u-boot': ['[email protected]'], 'simon': [self.leb], 'fred': [self.fred], + 'joe': [self.joe], } text = self._get_text('test01.txt')
@@ -259,6 +260,7 @@ class TestFunctional(unittest.TestCase): self.assertEqual('Postfix:\t some-branch', next(lines)) self.assertEqual('Cover: 4 lines', next(lines)) self.assertEqual(' Cc: %s' % self.fred, next(lines)) + self.assertEqual(' Cc: %s' % self.joe, next(lines)) self.assertEqual(' Cc: %s' % self.leb, next(lines)) self.assertEqual(' Cc: %s' % mel, next(lines))
@@ -272,7 +274,8 @@ class TestFunctional(unittest.TestCase): self.assertEqual(('%s %s\0%s' % (args[0], rick, stefan)), cc_lines[0]) self.assertEqual( - '%s %s\0%s\0%s\0%s' % (args[1], self.fred, self.leb, rick, stefan), + '%s %s\0%s\0%s\0%s\0%s' % (args[1], self.fred, self.joe, self.leb, + rick, stefan), cc_lines[1]) expected = '''
tools/patman/patchstream.py +2 -0
@@ -475,6 +475,8 @@ class PatchStream: elif name == 'changes': self.in_change = 'Commit' self.change_version = self._parse_version(value, line) + elif name == 'cc': + self.commit.add_cc(value.split(',')) else: self._add_warn('Line %d: Ignoring Commit-%s' % (self.linenum, name))
tools/patman/patman.rst +1 -1
@@ -350,7 +350,7 @@ Cover-changes: n - This line will only appear in the cover letter <blank line> -Patch-cc: Their Name <email> +Patch-cc / Commit-cc: Their Name <email> This copies a single patch to another email address. Note that the Cc: used by git send-email is ignored by patman, but will be interpreted by git send-email if you use it.
tools/patman/test/0002-fdt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch +1 -0
@@ -21,6 +21,7 @@ Series-cc: Stefan Brüns <[email protected]> Cover-letter-cc: Lord Mëlchett <[email protected]> Series-version: 3 Patch-cc: fred +Commit-cc: joe Series-process-log: sort, uniq Series-changes: 4 - Some changes
tools/patman/test/test01.txt +1 -0
@@ -49,6 +49,7 @@ Date: Sat Apr 15 15:39:08 2017 -0600 Cover-letter-cc: Lord Mëlchett <[email protected]> Series-version: 3 Patch-cc: fred + Commit-cc: joe Series-process-log: sort, uniq Series-changes: 4 - Some changes
Signature · 1 line
2.37.1
Re: [PATCH 2/3] patman: Add Commit-cc as an alias for Patch-cc
Quoted 6 lines · Sean Anderson
Most tags referring to commits (or patches) are named Commit-something. The exception is Patch-cc. Add a Commit-cc alias so we can use whichever one is convenient.
Signed-off-by Sean Anderson <[email protected]>
Quoted 8 lines
---
tools/patman/func_test.py | 5 ++++- tools/patman/patchstream.py | 2 ++ tools/patman/patman.rst | 2 +- ...dt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 9 insertions(+), 2 deletions(-)
Simon Glass
Reviewed-byRe: [PATCH 2/3] patman: Add Commit-cc as an alias for Patch-cc
Quoted 6 lines · Sean Anderson
Most tags referring to commits (or patches) are named Commit-something. The exception is Patch-cc. Add a Commit-cc alias so we can use whichever one is convenient.
Signed-off-by Sean Anderson <[email protected]>
Quoted 8 lines
---
tools/patman/func_test.py | 5 ++++- tools/patman/patchstream.py | 2 ++ tools/patman/patman.rst | 2 +- ...dt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 9 insertions(+), 2 deletions(-)
Applied to u-boot-dm, thanks!
PATCH 3/3 patman: Add a tag for when a patch gets added to a series
In reply to Sean AndersonWhen a patch is added to a series after the initial version, there are no changes to note except that it is new. This is typically done to suppress the "(no changes in vN)" message. It's also nice to add a change to the cover letter so reviewers know there is an additional patch. Add a tag to automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are probably just noise in most series, but they may be useful for treewide series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so I've left them in.
Suggestions for the above appreciated.
---
tools/patman/func_test.py | 2 ++ tools/patman/patchstream.py | 5 +++++ tools/patman/patman.rst | 13 +++++++++++++ ...t-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 22 insertions(+)
tools/patman/func_test.py +2 -0
@@ -293,6 +293,7 @@ Changes in v4: change - Some changes - Some notes for the cover letter +- fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base() Simon Glass (2): pci: Correct cast for sandbox
@@ -342,6 +343,7 @@ Changes in v4: - Multi line change +- New - Some changes Changes in v2:
tools/patman/patchstream.py +5 -0
@@ -477,6 +477,11 @@ class PatchStream: self.change_version = self._parse_version(value, line) elif name == 'cc': self.commit.add_cc(value.split(',')) + elif name == 'added-in': + version = self._parse_version(value, line) + self.commit.add_change(version, '- New') + self.series.AddChange(version, None, '- %s' % + self.commit.subject) else: self._add_warn('Line %d: Ignoring Commit-%s' % (self.linenum, name))
tools/patman/patman.rst +13 -0
@@ -350,6 +350,19 @@ Cover-changes: n - This line will only appear in the cover letter <blank line> +Commit-added-in: n + Add a change noting the version this commit was added in. This is + equivalent to:: + + Commit-changes: n + - New + + Cover-changes: n + - <commit subject> + + It is a convenient shorthand for suppressing the '(no changes in vN)' + message. + Patch-cc / Commit-cc: Their Name <email> This copies a single patch to another email address. Note that the Cc: used by git send-email is ignored by patman, but will be
tools/patman/test/0002-fdt-Correct-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch +1 -0
@@ -23,6 +23,7 @@ Series-version: 3 Patch-cc: fred Commit-cc: joe Series-process-log: sort, uniq +Commit-added-in: 4 Series-changes: 4 - Some changes - Multi
tools/patman/test/test01.txt +1 -0
@@ -51,6 +51,7 @@ Date: Sat Apr 15 15:39:08 2017 -0600 Patch-cc: fred Commit-cc: joe Series-process-log: sort, uniq + Commit-added-in: 4 Series-changes: 4 - Some changes - Multi
Signature · 1 line
2.37.1
Re: [PATCH 3/3] patman: Add a tag for when a patch gets added to a series
Hi,
Quoted 20 lines · Sean Anderson
When a patch is added to a series after the initial version, there are no changes to note except that it is new. This is typically done to suppress the "(no changes in vN)" message. It's also nice to add a change to the cover letter so reviewers know there is an additional patch. Add a tag to automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are probably just noise in most series, but they may be useful for treewide series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so I've left them in.Suggestions for the above appreciated.
Suggested-by Douglas Anderson <[email protected]>Signed-off-by Sean Anderson <[email protected]>
Quoted 8 lines
---
tools/patman/func_test.py | 2 ++ tools/patman/patchstream.py | 5 +++++ tools/patman/patman.rst | 13 +++++++++++++ ...t-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 22 insertions(+)
I love it, thanks!
Simon Glass
Reviewed-byRe: [PATCH 3/3] patman: Add a tag for when a patch gets added to a series
Quoted 33 lines · Doug Anderson
Hi,
Quoted 20 lines · Sean Anderson
When a patch is added to a series after the initial version, there are no changes to note except that it is new. This is typically done to suppress the "(no changes in vN)" message. It's also nice to add a change to the cover letter so reviewers know there is an additional patch. Add a tag to automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are probably just noise in most series, but they may be useful for treewide series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so I've left them in.Suggestions for the above appreciated.
Suggested-by Douglas Anderson <[email protected]>Signed-off-by Sean Anderson <[email protected]>Quoted 8 lines
---
tools/patman/func_test.py | 2 ++ tools/patman/patchstream.py | 5 +++++ tools/patman/patman.rst | 13 +++++++++++++ ...t-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 22 insertions(+)
Quoted 3 lines
I love it, thanks!
Reviewed-by Douglas Anderson <[email protected]>
Simon Glass
Reviewed-byRe: [PATCH 3/3] patman: Add a tag for when a patch gets added to a series
Quoted 33 lines · Doug Anderson
Hi,
Quoted 20 lines · Sean Anderson
When a patch is added to a series after the initial version, there are no changes to note except that it is new. This is typically done to suppress the "(no changes in vN)" message. It's also nice to add a change to the cover letter so reviewers know there is an additional patch. Add a tag to automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are probably just noise in most series, but they may be useful for treewide series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so I've left them in.Suggestions for the above appreciated.
Suggested-by Douglas Anderson <[email protected]>Signed-off-by Sean Anderson <[email protected]>Quoted 8 lines
---
tools/patman/func_test.py | 2 ++ tools/patman/patchstream.py | 5 +++++ tools/patman/patman.rst | 13 +++++++++++++ ...t-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 22 insertions(+)
Quoted 3 lines
I love it, thanks!
Reviewed-by Douglas Anderson <[email protected]>
Applied to u-boot-dm, thanks!
Re: [PATCH 3/3] patman: Add a tag for when a patch gets added to a series
In reply to Sean AndersonHi,
Quoted 54 lines · Sean Anderson
When a patch is added to a series after the initial version, there are no changes to note except that it is new. This is typically done to suppress the "(no changes in vN)" message. It's also nice to add a change to the cover letter so reviewers know there is an additional patch. Add a tag to automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are probably just noise in most series, but they may be useful for treewide series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so I've left them in.Suggestions for the above appreciated.
Suggested-by Douglas Anderson <[email protected]>Signed-off-by Sean Anderson <[email protected]>---
tools/patman/func_test.py | 2 ++ tools/patman/patchstream.py | 5 +++++ tools/patman/patman.rst | 13 +++++++++++++ ...t-cast-for-sandbox-in-fdtdec_setup_mem_siz.patch | 1 + tools/patman/test/test01.txt | 1 + 5 files changed, 22 insertions(+)tools/patman/func_test.py +2
-0@@ -293,6 +293,7 @@ Changes in v4: change - Some changes - Some notes for the cover letter +- fdt: Correct cast for sandbox in fdtdec_setup_mem_size_base() Simon Glass (2): pci: Correct cast for sandbox@@ -342,6 +343,7 @@ Changes in v4: - Multi line change +- New - Some changes Changes in v2:tools/patman/patchstream.py +0
-0
tools/patman/patchstream.py class PatchStream: · line 484
Quoted 8 lines
tools/patman/patchstream.py +5
-0@@ -477,6 +477,11 @@ class PatchStream: self.change_version = self._parse_version(value, line) elif name == 'cc': self.commit.add_cc(value.split(',')) + elif name == 'added-in': + version = self._parse_version(value, line) + self.commit.add_change(version, '- New') + self.series.AddChange(version, None, '- %s' % + self.commit.subject)
I won't have a chance to track this down right now, but I figured I'd at least report it. Maybe it's already been looked at?
Once before when I used this I saw a case where using "Commit-added-in" was doubling tags. AKA I end up seeing:
- New
- New
When I came back to try to look at it later I couldn't reproduce it. I'm seeing it again now. I did the bare minimum to debug and I see that the code in process_line() is being run twice for the same line. The first seems to be in get_metadata_for_list() and the second in process_stream().
I can do a quick-n-dirty fix for this, but presumably it would be better to dig into the real root cause?
-Doug