aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/series.py
AgeCommit message (Collapse)AuthorFilesLines
2022-03-02patman: Correct pylint errorsSimon Glass1-2/+1
Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Rename Color() method to build()Simon Glass1-6/+6
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 Glass1-8/+8
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 get_maintainer.pySimon Glass1-1/+1
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 commit.pySimon Glass1-1/+1
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-10-31patman: Add "postfix" support to patch subjectsSean Anderson1-2/+7
In some communities, it may be necessary to append something after PATCH in the subject line. For example, the Linux networking subsystem expects [1] patch subject prefixes like [RFC PATCH net-next 0/99]. This adds support for such "postfix"s to patman. Although entirely cosmetic, it is still nice to have. [1] https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html#how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-22patman: Quieten down the alias checkingSimon Glass1-5/+5
When a tag is used in a patch subject (e.g. "tag: rest of message") and it cannot be found as an alias, patman currently reports a fatal error, unless -t is provided, in which case it reports a warning. Experience suggest that the fatal error is not very useful. Instead, default to reporting a warning, with -t tell patman to ignore it altogether. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-03fix patman --limit-cc optionBernhard Kirchen1-1/+1
patman's --limit-cc option parses its argument to an integer and uses that to trim the list of CC recipients to a particular maximum. but that only works if the cc variable is a list, which it is not. Signed-off-by: Bernhard Kirchen <bernhard.kirchen@mbconnectline.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-13patman: Drop unicode helper functionsSimon Glass1-3/+1
We don't need these now that everything uses Python 3. Remove them and the extra code in GetBytes() and ToBytes() too. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Add a Series-patchwork-url optionSimon Glass1-1/+1
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-05patman: Convert 'Series-xxx' tag errors into warningsSimon Glass1-1/+5
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. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Allow linking a series with patchworkSimon Glass1-1/+1
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 in a later patch. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-24patman: Move main code out to a control moduleSimon Glass1-1/+1
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 Rini1-1/+1
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: Move main code out to a control moduleSimon Glass1-1/+1
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-09patman: Pass in maintainer dirs to avoid and importSimon Glass1-1/+2
Adjust the get_maintainer module to accept a list of directories to search for the script. This avoids needing to import gitutil. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
2020-05-29patman: Add new tags for finer-grained changelog controlSean Anderson1-2/+13
By default patman generates a combined changelog for the cover letter. This may not always be desirable. Many patches may have the same changes. These can be coalesced with "Series-process-log: uniq", but this is imperfect. Similar changes like "Move foo to patch 7" will not be merged with the similar "Move foo to this patch from patch 6". Changes may not make sense outside of the patch they are written for. For example, a change line of "Add check for bar" does not make sense outside of the context in which bar might be checked for. Some changes like "New" or "Lint" may be repeated many times throughout different change logs, but carry no useful information in a summary. Lastly, I like to summarize the broad strokes of the changes I have made in the cover letter, while documenting all the details in the appropriate patches. I think this makes it easier to get a good feel for what has changed, without making it difficult to wade through every change in the whole series. This patch adds two new tags to add changelog entries which only appear in the cover letter, or only appear in the commit. Changes documented with "Commit-changes" will only appear in the commit, and will not appear in the cover letter. Changes documented with "Cover-changes" will not appear in any commit, and will only appear in the cover letter. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Suppress empty changelog entriesSean Anderson1-12/+31
Patman outputs a line for every edition of the series in every patch, regardless of whether any changes were made. This can result in many redundant lines in patch changelogs, especially when a patch did not exist before a certain revision. For example, the existing behaviour could result in a changelog of Changes in v7: None Changes in v6: None Changes in v5: - Make a change Changes in v4: None Changes in v3: - New Changes in v2: None With this patch applied and with --no-empty-changes, the same patch would look like (no changes since v5) Changes in v5: - Make a change Changes in v3: - New This is entirely aesthetic, but I think it reduces clutter, especially for patches added later on in a series. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Move to absolute importsSimon Glass1-5/+5
At present patman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move patman to use absolute imports. This requires changes in tools which use the patman libraries (which is most of them). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Drop references to __future__Simon Glass1-2/+0
We don't need these now that the tools using Python 3. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-16patman: Apply the cc limit to the cover letter alsoSimon Glass1-2/+4
Quite often on a series that has clean-up patches, the individual patches may fit within the cc limit but the cover letter does not. Apply the same limit to the cover letter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Chris Packham <judge.packham@gmail.com>
2019-11-14patman: fix coverletter cc list with nullsRobert Beckett1-1/+1
fixes: 8ab452d5877638a97e5bdd521d119403b70b45f5 When compiling list of cover letter cc addresses, using null as a separater, then encoding to utf-8 results in lots of "\x00" as separators. patman then doesnt understand that when it comes to repoting the list to send-email. Fix this by not encoding to utf-8, as done for the other patch files. Signed-off-by: Robert Beckett <bob.beckett@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-11-04patman: Use unicode for file I/OSimon Glass1-1/+1
At present patman test fail in some environments which don't use utf-8 as the default file encoding. Add this explicitly. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-27patman: separate emails in CC list with NULsDmitry Torokhov1-2/+2
There is a contributor in Linux kernel with a comma in their name, which confuses patman and results in invalid to- or cc- addresses on some patches. To avoid this, let's use \0 as a separator when generating cc file. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-10patman: Tidy up a few more unicode conversionsSimon Glass1-3/+2
Use the new functions in the tools module to handle conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10patman: Sort series output for repeatabilySimon Glass1-6/+6
We use sets to produce the list of To and Cc lines for a series. This does not result in stable ordering of the recipients. Sort each list to ensure that the output is repeatable. This is necessary for tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-10patman: Move unicode helpers to toolsSimon Glass1-1/+2
Create helper functions in the tools module to deal with the differences between unicode in Python 2 (where we use the 'unicode' type) and Python 3 (where we use the 'str' type). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-23patman: add option for limiting the Cc listChris Packham1-1/+4
Many mailing-lists consider a long Cc list a sign of spam and will either drop the message or mark it for moderation. Because patman automatically invokes get_maintainer.pl the Cc list can expand unexpectedly. Allow the user to specify a limit for the Cc list. This limit is applied after removing any known bouncing addresses. By default no limit is applied. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-11patman: add support for omitting bouncing addressesChris Packham1-0/+5
Add support for reading a list of bouncing addresses from a in-tree file (doc/bounces) and from the ~/.patman config file. These addresses are stripped from the Cc list. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com <mailto:philipp.tomsich@theobroma-systems.com>>
2017-06-08patman: Rename 'list' variable in MakeCcFile()Simon Glass1-10/+10
This is not a good variable name in Python because 'list' is a type. It shows up highlighted in some editors. Rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08patman: Add a maintainer test feature to MakeCcFile()Simon Glass1-2/+6
Allow the add_maintainers parameter to be a list of maintainers, thus allowing us to simulate calling the script in tests without actually needing it to work. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08patman: Adjust handling of unicode email addressSimon Glass1-3/+7
Don't mess with the email address when outputting them. Just make sure they are encoded with utf-8. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08patman: encode CC list to UTF-8Philipp Tomsich1-2/+2
This change encodes the CC list to UTF-8 to avoid failures on maintainer-addresses that include non-ASCII characters (observed on Debian 7.11 with Python 2.7.3). Without this, I get the following failure: Traceback (most recent call last): File "tools/patman/patman", line 159, in <module> options.add_maintainers) File "[snip]/u-boot/tools/patman/series.py", line 234, in MakeCcFile print(commit.patch, ', '.join(set(list)), file=fd) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 81: ordinal not in range(128) from Heiko's email address: [..., u'"Heiko St\xfcbner" <heiko@sntech.de>', ...] While with this change added this encodes to: "=?UTF-8?q?Heiko=20St=C3=BCbner?= <heiko@sntech.de>" Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-02-08patman: Handle non-ascii characters in namesChris Packham1-1/+2
When gathering addresses for the Cc list patman would encounter a UnicodeDecodeError due to non-ascii characters in the author name. Address this by explicitly using utf-8 when building the Cc list. Signed-off-by: Chris Packham <judge.packham@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-10-09patman: Make print statements python 3.x safePaul Burton1-18/+20
In python 3.x, print must be used as a function call. Convert all print statements to the function call style, importing from __future__ where we print with no trailing newline or print to a file object. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-10-09patman: Replace tabs with spacesPaul Burton1-2/+2
In preparation for running on python 3.x, which will refuse to run scripts which mix tabs & spaces for indentation, replace 2 tab characters present in series.py with spaces. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-02-24patman: fix series-notes handling for buildmanAlbert ARIBAUD1-1/+4
A patman series with a 'Series-notes' section causes buildman to crash with: self.series.notes += self.section TypeError: cannot concatenate 'str' and 'list' objects Fix by initializing series.notes as a one-element array rather than a scalar. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2015-08-31buildman: Correct 'Series-cover-cc' detection logicSimon Glass1-1/+1
This requires 'Series-cover_cc' at present which is incorrect. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23patman: check git format.subjectprefix setting when generate patches prefixWu, Josh1-1/+7
For the local project, we may specified format.subjectprefix setting. Then the patch will be formated as [Project_prefix][PATCH]. But patman will not check this setting. It will remove the format.subjectprefix. So This patch will let patman check this setting and add it as a project prefix. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2015-01-30patman: Make dry-run output match real functionalityPeter Tyser1-13/+8
When run with the --dry-run argument patman prints out information showing what it would do. This information currently doesn't line up with what patman/git send-email really do. Some basic examples: - If an email address is addressed via "Series-cc" and "Patch-cc" patman shows that email address would be CC-ed two times. - If an email address is addressed via "Series-to" and "Patch-cc" patman shows that email address would be sent TO and CC-ed. - If an email address is addressed from a combination of tag aliases, get_maintainer.pl output, "Series-cc", "Patch-cc", etc patman shows that the email address would be CC-ed multiple times. Patman currently does try to send duplicate emails like the --dry-run output shows, but "git send-email" intelligently removes duplicate addresses so this patch shouldn't change the non-dry-run functionality. Change patman's output and email addressing to line up with the "git send-email" logic. This trims down patman's dry-run output and prevents confusion about what patman will do when emails are actually sent. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-09-21patman: Add a -m option to avoid copying the maintainersSimon Glass1-2/+5
The get_maintainers script is a useful default, but sometimes is copies too many people, or takes a long time to run. Add an option to disable it and update the README. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk1-17/+1
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-05-09buildman: Allow conflicting tags to avoid spurious errorsSimon Glass1-1/+3
Conflicting tags can prevent buildman from building two series which exist one after the other in a branch. There is no reason not to allow this sort of workflow with buildman, so ignore conflicting tags in buildman. Change-Id: I2231d04d8684fe0f8fe77f8ea107e5899a3da5e8 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
2013-04-08patman: Add Series-process-log tag to sort/uniq change logsSimon Glass1-2/+7
For some series with lots of changes it is annoying that duplicate change log items are not caught. It is also helpful sometimes to sort the change logs. Add a Series-process-log tag to enable this, which can be placed in a commit to control this. The change to the Cc: line is to fix a checkpatch warning. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-08patman: Provide option to ignore bad aliasesSimon Glass1-3/+7
Often it happens that patches include tags which don't have aliases. It is annoying that patman fails in this case, and provides no option to continue other than adding empty tags to the .patman file. Correct this by adding a '-t' option to ignore tags that don't exist. Print a warning instead. Since running the tests is not a common operation, move this to --test instead, to reserve -t for this new option. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-04patman: Add Cover-letter-cc tag to Cc cover letter to peopleSimon Glass1-3/+8
The cover letter is sent to everyone who is on the Cc list for any of the patches in the series. Sometimes it is useful to send just the cover letter to additional people, so that they are aware of the series, but don't need to wade through all the individual patches. Add a new Cover-letter-cc tag for this purpose. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-01-31patman: Add a call to get_maintainer.pl if it existsDoug Anderson1-0/+2
For Linux the best way to figure out where to send a patch is with the "get_maintainer.pl" script. Add support for calling it from patman. Support is added unconditionally for "scripts/get_maintainer.pl" in case it is helpful for any other projects. Signed-off-by: Doug Anderson <dianders@chromium.org>
2013-01-31patman: Add all CC addresses to the cover letterDoug Anderson1-1/+11
If we're sending a cover letter make sure to CC everyone that we're CCing on each of the individual patches. Signed-off-by: Doug Anderson <dianders@chromium.org>
2013-01-31patman: Cache the CC list from MakeCcFile() for use in ShowActions()Doug Anderson1-4/+9
Currently we go through and generate the CC list for patches twice. This gets slow when (in a future CL) we add a call to get_maintainer.pl on Linux. Instead of doing things twice, just cache the CC list when it is first generated. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>