summaryrefslogtreecommitdiff
path: root/tools/patman/control.py
AgeCommit message (Collapse)Author
2025-05-27patman: Implement the upstream subcommandSimon Glass
Add a command to allow managing the upstream tree. This is very basic so far, only allowing setting the name and URL. Further work may allow checking whether series apply cleaning on the upstream tree, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Implement the series subcommandSimon Glass
Add a command to support management of series. These are local branches which may have been sent to the mailing list, so may appear on the patchwork server. The new functionality uses a database, stored in a local file. Various operations are supported: - add a new series - send a series and automatically link it with patchwork - 'increment' the version, to prepare to send an updated series - gather review/test tags from patchwork - check on progress, i.e. patches which are received new tags or comments - show comments on patches and cover letters Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Implement the patchwork subcommandSimon Glass
Add a command to allow setting and getting the patchwork project. This is needed so that patman can use the correct ID when talking to the patchwork server. To support testing, allow passing in the test database, patchwork object and Cseries object. Fake versions can then easily be provided for certain test cases. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Improve Series support for patchwork linksSimon Glass
Update Series with a way to better manage the Series-links lines in patches. Use this in the 'status' subcommand instead of the existing primitive method of expecting a link without a version prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move common test code into a new moduleSimon Glass
The func_test file is quite large. In order to allow new tests to be added to a separate file, move the common test code into a separate class, to be inherited by other classes. Drop unnecessary imports in func_test Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move -H out of the send commandSimon Glass
This is the help for the whole of patman, so move it to the start of the control function, rather than being inside 'patman send'. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Untangle settings from gitutilSimon Glass
The gitutil module is supposed to be independent from patman but one piece was missed in the series which separated them. Move the settings setup out of gitutil Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Provide an option to run in single-threaded modeSimon Glass
Patman normally sends multiple concurrent requests to the patchwork server, as this is faster. Provide an option to disable this. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Adjust how the fake request() function is providedSimon Glass
Instead of passing the URL and function to each call, put the fake into the Patchwork object instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Rename check_patchwork_status()Simon Glass
This function actually shows the status and does some other things. Rename it to better reflect its purpose. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move code for sending into its own moduleSimon Glass
The control module includes much of the implementation of patman's 'send' feature. As a first step to separating this out, move the sending code into its own file. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Tidy up the start-up codeSimon Glass
Much of this was written before the other Python tools and they have evolved. Make a few updates: - Rather than calling sys.exit(), return the exit code from the control module and use it in __main__ - Set up tout as it is used in some places - We now have quite a few tests, so update the comment about that Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-27patman: Move all non-test logic into control moduleSimon Glass
It is easier for tests if the top-level control logic is all in one module. Create a new do_patman() function to handle this. Move the existing code into it. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-10patman: Show base commit on each patch when no cover letterSimon Glass
If a series is sent without a cover letter, there is no indication of the base commit. Add support for this, since single patches of small series may not always have a cover letter. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-17u_boot_pylib: Move gitutil into the librarySimon Glass
Move this file into U-Boot's Python library, so that it is no-longer part of patman. This makes a start on: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35 Signed-off-by: Simon Glass <sjg@chromium.org>
2023-11-02patman: Add a 'keep_change_id' settingMaxim Cournoyer
A Change-Id can be useful for traceability purposes, and some projects may wish to have them preserved. This change makes it configurable via a new 'keep_change_id' setting. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Drop an incorrect comment about git amSimon Glass
Patman does not do this anymore, as of this commit: 7428dc14b0f ("patman: Remove the -a option") Drop the comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
2023-03-08patman: Move library functions into a library directorySimon Glass
The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-05patman: add '--get-maintainer-script' argumentMaxim Cournoyer
This makes it possible to configure a project to use some other location or script than the default scripts/get_maintainer.pl one used in the U-Boot and Linux projects. It can be configured via a .patman configuration file and accepts arguments, as documented. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
2022-07-26patman: By default don't pass "--no-tree" to checkpatch for linuxDouglas Anderson
When you pass "--no-tree" to checkpatch it disables some extra checks that are important for Linux. Specifically I want checks like: warning: DT compatible string "boogie,woogie" appears un-documented check ./Documentation/devicetree/bindings/ Let's make the default for Linux to _not_ pass --no-tree. We'll have a config option and command line flag to override. Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Rename Color() method to build()Simon Glass
This method has the same name as its class which is confusing. It is also annoying when searching the code. It builds a string with a colour, so rename it to build(). Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in gitutil.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in checkpatch.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-22patman: Add --no-signoff to suppress adding signoffsPhilipp Tomsich
To enable use of patman with FSF/GNU projects, such as GCC or Binutils, no Signed-off-by may be added. This adds a command line flag '--no-signoff' to suppress adding signoffs in patman when processing commits. Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Reviewed-by: Simon Glass <sjg@chromium.org> Fix patman testBranch() test: Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Add a Series-patchwork-url optionSimon Glass
Add a commit tag to allow the Patchwork URL to be specified in a commit. This can be handy for when you submit code to multiple projects but don't want to use the -p option. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Allow specifying the patchwork URLSimon Glass
Add a new argument to allow the URL of the patchwork server to be speciified. For now this is hard-coded in the main file, but future patches will move it to the settings file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Support listing comments from patchworkSimon 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 <sjg@chromium.org>
2020-11-05patman: Support updating a branch with review tagsSimon 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 <sjg@chromium.org>
2020-11-05patman: Support checking for review tags in patchworkSimon 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 'status' subcommand that checks patchwork for review tags, showing those which are not present in the local branch. This allows users to see what new review tags have been received and then add them. Sample output: $ patman status 1 Subject 1 Reviewed-by: Joe Bloggs <joe@napierwallies.co.nz> 2 Subject 2 Tested-by: Lord Edmund Blackaddër <weasel@blackadder.org> Reviewed-by: Fred Bloggs <f.bloggs@napier.net> + Reviewed-by: Mary Bloggs <mary@napierwallies.co.nz> 1 new response available in patchwork The '+' indicates a new tag. Colours are used to make it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Rename functions in patchstreamSimon Glass
Rename these functions to lower case as per PEP8. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Correct operation of -nSimon 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: Simon Glass <sjg@chromium.org>
2020-07-25patman: When no tracking branch is provided, tell the userNicolas Boichat
The user can either count the number of patches, or provide a tracking branch. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-25patman: Make sure sendemail.suppresscc is (un)set correctlyNicolas Boichat
Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd parameter being ignored, and emails going either nowhere, or just to the To: line maintainer. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-24patman: Convert to ArgumentParserSimon Glass
Convert from OptionParser to ArgumentParser to match binman. With this we can easily add sub-commands. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24patman: Allow skipping patches at the endSimon Glass
The -s option allows skipping patches at the top of the branch. Sometimes there are commits at the bottom that need to be skipped. At present it is necessary to count the number of commits and then use -c to tell patman how many to process. Add a -e option to easily skip a number of commits at the bottom of the branch. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24patman: Allow creating patches for another branchSimon Glass
Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24patman: Move main code out to a control moduleSimon Glass
To make testing easier, move the code out from main into a separate 'control' module and split it into four parts: setup, preparing patches, checking patches and emailing patches. Add comments and fix a few code-style issues while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini
This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-20patman: When no tracking branch is provided, tell the userNicolas Boichat
The user can either count the number of patches, or provide a tracking branch. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Make sure sendemail.suppresscc is (un)set correctlyNicolas Boichat
Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd parameter being ignored, and emails going either nowhere, or just to the To: line maintainer. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Convert to ArgumentParserSimon Glass
Convert from OptionParser to ArgumentParser to match binman. With this we can easily add sub-commands. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Allow skipping patches at the endSimon Glass
The -s option allows skipping patches at the top of the branch. Sometimes there are commits at the bottom that need to be skipped. At present it is necessary to count the number of commits and then use -c to tell patman how many to process. Add a -e option to easily skip a number of commits at the bottom of the branch. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Allow creating patches for another branchSimon Glass
Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Move main code out to a control moduleSimon Glass
To make testing easier, move the code out from main into a separate 'control' module and split it into four parts: setup, preparing patches, checking patches and emailing patches. Add comments and fix a few code-style issues while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>