[PATCH v2 30/30] patman: Support listing comments from patchwork

2020-10-25 Thread Simon Glass
While reviewing feedback it is helpful to see the review comments on the command line to check that each has been addressed. Add an option to support that. Update the workflow documentation to describe the new features. Signed-off-by: Simon Glass --- Changes in v2: - Many changes to the whole s

[PATCH v2 29/30] patman: Support parsing of review snippets

2020-10-25 Thread Simon Glass
Add support for parsing the contents of a patchwork 'patch' web page containing comments received from reviewers. This allows patman to show these comments in a simple 'snippets' format. A snippet is some quoted code plus some unquoted comments below it. Each review is from a unique person/email a

[PATCH v2 26/30] patman: Detect missing upstream in CountCommitsToBranch

2020-10-25 Thread Simon Glass
At present if we fail to find the upstream then the error output is piped to wc, resulting in bogus results. Avoid the pipe and check the output directly. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 19 +++ tools/patman/gitutil.py | 10 +++

[PATCH v2 27/30] patman: Support checking for review tags in patchwork

2020-10-25 Thread Simon Glass
Before sending out a new version of a series for review, it is important to add any review tags (e.g. Reviewed-by, Acked-by) collected by patchwork. Otherwise people waste time reviewing the same patch repeatedly, become frustrated and stop reviewing your patches. To help with this, add a new 'sta

[PATCH v2 28/30] patman: Support updating a branch with review tags

2020-10-25 Thread Simon Glass
It is tedious to add review tags into the local branch and errors can sometimes be made. Add an option to create a new branch with the review tags obtained from patchwork. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/README | 17 ++- tools/patman/control.py |

[PATCH v2 24/30] patman: Allow showing a Commit as a string

2020-10-25 Thread Simon Glass
Use the subject of the Commit object when printing it out. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/commit.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/patman/commit.py b/tools/patman/commit.py index e49bf87dfc8..5bf2b940299 100644 --- a/tools/patman

[PATCH v2 23/30] patman: Don't ignore lines starting with hash

2020-10-25 Thread Simon Glass
These lines can indicate a continuation of an error and should not be ignored. Fix this. Fixes: 666eb15e923 ("patman: Handle checkpatch output with notes and code") Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/checkpatch.py | 7 +-- 1 file changed, 5 insertions(+), 2

[PATCH v2 25/30] patman: Improve handling of files

2020-10-25 Thread Simon Glass
Sometimes warnings are associated with a file and sometimes with the patch as a whole. Update the regular expression to handle both cases, even in emacs mode. Also add support for detecting new files. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/checkpatch.py | 11

[PATCH v2 22/30] patman: Fix spelling of plural for warning

2020-10-25 Thread Simon Glass
Tidy up the extra 's' when there is only a single warning. Fix the empty print statement also. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 5 +++-- tools/patman/patchstream.py | 9 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/t

[PATCH v2 21/30] patman: Require tags to be before sign-off

2020-10-25 Thread Simon Glass
At present it is possible to put sign-off tags before the change log. This works but then it is hard for patman to add its own tags to a commit. Also if the commit has a Change-Id (e.g. for Gerrit) the commit becomes invalid if there is anything after it. Report a warning if patman tags are in the

[PATCH v2 19/30] patman: Add some tests for warnings

2020-10-25 Thread Simon Glass
Add tests that check that warnings are generated when expected. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 111 +--- tools/patman/main.py| 16 +- tools/patman/patchstream.py | 2 +- 3 files changed, 116 inse

[PATCH v2 20/30] patman: Convert testBasic() to use an interator

2020-10-25 Thread Simon Glass
On balance it is easier to use an iterator here, particularly if we need to insert lines due to new functionality. The only niggle is the need to keep the previous iterator value around in one case. Convert this test to use iter(). Signed-off-by: Simon Glass --- (no changes since v1) tools/pa

[PATCH v2 18/30] patman: Add a test for PatchStream tags

2020-10-25 Thread Simon Glass
The current functional tests run most of patman. Add a smaller test that just checks tag handling with the PatchStream class. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 26 +- tools/patman/patchstream.py | 23 +

[PATCH v2 17/30] patman: Drop unused signoff member

2020-10-25 Thread Simon Glass
This is not used. Drop it. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 1 + tools/patman/patchstream.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py index bdeccafda0b..2290ba95e9

[PATCH v2 15/30] patman: Attach warnings to individual patches

2020-10-25 Thread Simon Glass
At present warnings are produced across the whole set of patches when parsing them. It is more useful to associate each warning with the patch (or commit) that generated it. Attach warnings to the Commit object and move them out of PatchStream. Also avoid generating duplicate warnings for the same

[PATCH v2 16/30] patman: Convert 'Series-xxx' tag errors into warnings

2020-10-25 Thread Simon Glass
If the Series-xxx tag is not recognised patman currently reports a fatal error. This is inconvenient if a new feature is later added to patman that an earlier version does not support. Report a warning instead, to allow the user to take action if needed, but still allow operation to proceed. Sign

[PATCH v2 14/30] patman: Move warning collection to a function

2020-10-25 Thread Simon Glass
Add a new function in PatchStream to collect the warnings generated while parsing the stream. This will allow us to adjust the logic, such as dealing with per-commit warnings. Two of the warnings are in fact internal errors, so change them to raise and exception. Signed-off-by: Simon Glass ---

[PATCH v2 12/30] patman: Drop unused args in patchstream

2020-10-25 Thread Simon Glass
Drop a few arguments that are not used in functions. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 3a057fbd6c4..c5402dd

[PATCH v2 13/30] patman: Fix up argument/return docs in patchstream

2020-10-25 Thread Simon Glass
Add missing documentation and type information. Fix up some missing docs on exceptions also. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 82 ++--- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/tools/patman

[PATCH v2 10/30] patman: Rename functions in patchstream

2020-10-25 Thread Simon Glass
Rename these functions to lower case as per PEP8. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/control.py | 6 +-- tools/patman/control.py | 6 +-- tools/patman/func_test.py | 6 +-- tools/patman/patchstream.py | 88

[PATCH v2 11/30] patman: Rename variables in patchstream

2020-10-25 Thread Simon Glass
Some variables are too short or shadow other variables or types. Fix these to keep pylint3 happy. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 52 ++--- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/p

[PATCH v2 08/30] patman: Fix indenting in patchstream

2020-10-25 Thread Simon Glass
Update the indenting to keep pylint3 happy. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index ba0a1

[PATCH v2 07/30] patman: Allow linking a series with patchwork

2020-10-25 Thread Simon Glass
Add a new Series-links tag to tell patman how to find the series in patchwork. Each item is the series ID optionally preceded by the series version that the link refers to. An empty version indicates this is the latest series. For example: Series-links: 209816 1:203302 Documentation is added

[PATCH v2 09/30] patman: Fix constant style in patchstream

2020-10-25 Thread Simon Glass
These constants should use upper case. Update them to keep pylint3 happy. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 44 ++--- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/patman/patchstream.py b/t

[PATCH v2 05/30] patman: Use capture_sys_output() consistently

2020-10-25 Thread Simon Glass
One test still uses its own function for capturing output. Modify it to use the standard one in test_util Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/tools/patman/func_t

[PATCH v2 06/30] patman: Fix remaining pylint3 warnings in func_test

2020-10-25 Thread Simon Glass
This fixes all but the ones about too many variables/statements. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 76 +-- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/tools/patman/func_test.py b/tools/patman

[PATCH v2 03/30] patman: Update how tests are run

2020-10-25 Thread Simon Glass
The current instructions are out-of-date. Fix them. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/README | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/patman/README b/tools/patman/README index 52b2cf70bd0..7ede1068ee1 100644 --- a/tools/p

[PATCH v2 04/30] patman: Fix whitespace errors in func_test

2020-10-25 Thread Simon Glass
Fix up various indentation and other minor things to make pylint3 happier. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/func_test.py | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tools/patman/func_test.py b/tool

[PATCH v2 01/30] patman: Correct operation of -n

2020-10-25 Thread Simon Glass
This operation was unfortunately broken by a recent change. It is now necessary to use -i in addition to -n, if there are errors or warnings in the patches. Correct this by always showing the summary information. Fixes: f3653759758 ("patman: Move main code out to a control module") Signed-off-by: