summaryrefslogtreecommitdiff
path: root/tools/patman
AgeCommit message (Collapse)Author
2015-02-15patman: Read in the git-mailrc alias fileSimon Glass
We should read this file to obtain a set of aliases. This reduces the need to create them in the ~/.patman file. This feature did exist in some version of patman, and is mentioned in the help but it did not find its way upstream. Reported-by: Graeme Russ <gruss@tss-engineering.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-15buildman: Fix incorrect arguemnt in GetUpstream()Simon Glass
This causes an error when trying to build a local branch which has a local branch as its upstream. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-01-30patman: Explain how to make doc/git-mailrc workSimon Glass
Add an explanation for how to set up git so that patman can find the alias file. Fix up the get_maintainers message too. Reported-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-30patman: Check commit_match before stripping leading whitespaceScott Wood
True commit lines start at column zero. Anything that is indented is part of the commit message instead. I noticed this by trying to run buildman with commit e3a4facdfc07179ebe017a07b8de6224a935a9f3 as master, which contained a reference to a Linux commit inside the commit message. ProcessLine saw that as a genuite commit line, and thus buildman tried to build it, and died with an exception because that SHA is not present in the U-Boot tree. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-01-30patman: Make dry-run output match real functionalityPeter Tyser
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>
2015-01-14buildman: Allow specifying a range of commits to buildSimon Glass
Adjust the -b flag to permit a range expression as well as a branch. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2015-01-14buildman: Try to guess the upstream commitSimon Glass
Buildman normally obtains the upstream commit by asking git. Provided that the branch was created with 'git checkout -b <branch> <some_upstream>' then this normally works. When there is no upstream, we can try to guess one, by looking up through the commits until we find a branch. Add a function to try this and print a warning if buildman ends up relying on it. Also update the documentation to match. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Wolfgang Denk <wd@denx.de>
2014-11-26patman: Use the full commit hash for 'git checkout'Simon Glass
Even with the initial 8 characeters of the hash we will sometimes get a collision. Use the full hash. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-21patman: Add a -m option to avoid copying the maintainersSimon Glass
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>
2014-09-09patman: make run results better visibleVadim Bendebury
For an occasional user of patman some failures are not obvious: for instance when checkpatch reports warnings, the dry run still reports that the email would be sent. If it is not dry run, the warnings are shown on the screen, but it is not clear that the email was not sent. Add some code to report failure to send email explicitly. Tested by running the script on a patch with style violations, observed error messages in the script output. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2014-09-09buildman: Ignore conflicting tagsSimon Glass
Tags like Series-version are normally expected to appear once, and with a unique value. But buildman doesn't actually look at these tags. So ignore conflicts. This allows bulidman to build a branch containing multiple patman series. Reported-by: Steve Rae <srae@broadcom.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09patman: Start with a clean series when neededSimon Glass
For reasons that are not well-understood, GetMetaDataForList() can end up adding to an existing series even when it appears that it should be starting a new one. Change from using a default constructor parameter to an explicit one, to work around this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09patman: Provide a way to intercept commands for testingSimon Glass
Add a test point for the command module. This allows tests to emulate the execution of commands. This provides more control (since we can make the fake 'commands' do whatever we like), makes it faster to write tests since we don't need to set up as much environment, and speeds up test execution. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09patman: RunPipe() should not pipe stdout/stderr unless askedSimon Glass
RunPipe() currently pipes the output of stdout and stderr to a pty, but this is not the intended behaviour. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09patman: Add a way of recording terminal output for testingSimon Glass
When running unit tests we don't want output to go to the terminal. Provide a way of collecting it so that it can be examined by test code later. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-05patman: Fix detection of git versionSimon Glass
A missing 'global' declaration means that this feature does not currently work. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-05patman: Avoid changing the order of tagsSimon Glass
patman collects tags that it sees in the commit and places them nicely sorted at the end of the patch. However, this is not really necessary and in fact is apparently not desirable. Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-05patman: Use --no-pager' to stop git from forking a pagerSimon Glass
In a headless environment the pager can apparently hang. We don't want a pager anyway so let's request that none be used. Reported-by: Tom Rini <trini@ti.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-05patman: Remove the -a optionSimon Glass
It seems that this is no longer needed, since checkpatch.pl will catch whitespace problems in patches. Also the option is not widely used, so it seems safe to just remove it. Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-05patman: Correct unit tests to run correctlySimon Glass
It seems that doctest behaves differently now, and some of the unit tests do not run. Adjust the tests to work correctly. ./tools/patman/patman --test <unittest.result.TestResult run=10 errors=0 failures=0> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-05patman: Fix indentation in terminal.pySimon Glass
This code came from a different project with 2-character indentation. Fix it for U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-08-28patman: Support the 'reverse' option for 'git log'Simon Glass
This option is currently not supported, but needs to be, for buildman to operate as expected. Reported-by: York Sun <yorksun@freescale.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-08-22patman: refactor help messageMasahiro Yamada
"patman [options]" is displayed by default. Append the rest of help messages to parser.usage instead of replacing it. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-08-21tools, scripts: refactor error-out statements of Python scriptsMasahiro Yamada
In Python, sys.exit() function can also take an object other than an integer. If an integer is given to the argument, Python exits with the return code of it. If a non-integer argument is given, Python outputs it to stderr and exits with the return code of 1. That means, print >> sys.stderr, "Blah Blah" sys.exit(1) is equivalent to sys.exit("Blah Blah") The latter is a useful shorthand. Note: Some error messages in Buildman and Patman were output to stdout. But they should go to stderr. They are also fixed by this commit. This is a nice side effect. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-08-13patman: Only use git's --no-decorate when availableSimon Glass
Older versions of git (e.g. Ubuntu 10.04) do not support this flag. By default they do not decorate. So only enable this flag when supported. Suggested-by: Tom Rini <trini@ti.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-08-13patman: Move the 'git log' command into a functionSimon Glass
Move the code that builds a 'git log' command into a function so we can more easily adjust it. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-07-28patman: make "No recipient" checking more tolerantMasahiro Yamada
If Series-to tag is missing, Patman exits with a message "No recipient". This is just annoying for those who had already added sendemail.to configuration. I guess many developers have [sendemail] to = u-boot@lists.denx.de in their .git/config because the 'To: u-boot@lists.denx.de' field should always be added when sending patches. That seems more reasonable rather than adding 'Series-to: u-boot@lists.denx.de' to every patch series. Patman should exit only when both Series-to tag and sendemail.to configuration are mising. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2014-07-07patman: Only apply patches when we know the original HEADSimon Glass
When patman applies the patches it checks out a new branch, uses 'git am' to apply the patches one by one, and then tries to go back to the old branch. If you try this when the branch is 'undefined', this doesn't work as patman cannot restore the correct branch after applying the patches. It seems that 'undefined' is created by git and is persistent after it is created, so that you can end up on quite an old branch. Add a check for the 'undefined' branch to avoid this. Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-16patman: Suppress duplicate signoffs only for real patchesSimon Glass
There is an unfortunate bug in the signoff suppression logic. The first pass is performed with 'git log', and all signoffs are added to the supression set, such that the second time (when processing the real patches) we always suppress the signoffs. Correct this by only suppressing signoffs in the second pass. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Michal Simek <monstr@monstr.eu> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-05-09patman: Avoid duplicate sign-offsSimon Glass
Keep track of all Signed-off-by tags in a commit and silently suppress any duplicates. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-09patman: Deal with 'git apply' failures correctlySimon Glass
This sort of failure is rare, but the code to deal with it is wrong. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-22patman: Use Patch-cc: instead of Cc:Simon Glass
Add a new Patch-cc: tag which performs the service now provided by the Cc: tag. The Cc: tag is interpreted by git send-email but ignored by patman. So now: Cc: patman does nothing. (git send-email can cc patches) Patch-cc: patman Cc's patch and removes this tag from the patch Signed-off-by: Simon Glass <sjg@chromium.org>
2013-11-21patman: add Commit-notes tag and sectionAlbert ARIBAUD
Sometimes a commit should have notes enclosed with it rather than withing the cover letter -- possibly even because there is no cover letter. Add a 'Commit-notes' tag, similar to the 'Series-notes' one; lines between this tag and the next END line are inserted in the patch right after the '---' commit delimiter. Change-Id: I01e99ae125607dc6dec08f3be8a5a0b37f0a483d Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Simon Glass <sjg@chromium.org> (Updated README)
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-07-15patman: README documentation nits (unit test)Gerhard Sittig
adjust instructions for the invocation of Patman's self test: the -t flag appears to have a different meaning now, refer to the --test option for the builtin unit test; adjust a directory location and make sure to run the file which resides in the source directory Signed-off-by: Gerhard Sittig <gsi@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
2013-05-14buildman: Produce a sensible error message when branch is missingSimon Glass
Rather than a backtrace, produce a nice error message when an invalid branch is provided to buildman. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-09patman: Do not hardcode python pathMichal Simek
Patman requires python 2.7.4 to run but it doesn't need to be placed in /usr/bin/python. Use env to ensure that the interpreter used is the first one on environment's $PATH on system with several versions of Python installed. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
2013-05-09buildman: Allow conflicting tags to avoid spurious errorsSimon Glass
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-18patman: fix gitutil for decorationsAndreas Bießmann
The git config parameter log.decorate is quite useful when working with git. Patman, however can not handle the decorated output when parsing the commit. To prevent this use the '--no-decorate' switch for git-log. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Simon Glass <sjg@chromium.org>
2013-04-08patman: Add Series-process-log tag to sort/uniq change logsSimon Glass
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: Add -a option to refrain from test-applying the patchesSimon Glass
Especially with the Linux kernel, it takes a long time (a minute or more) to test-apply the patches, so patman becomes significantly less useful. The only real problem that is found with this apply step is trailing spaces. Provide a -a option to skip this step, for those working with clean patches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-08patman: Don't barf if the word 'commit' starts a lineDoug Anderson
Patman's regular expression for detecting the start of a commit in a git log was a little simplistic and could be confused if the git log itself had the word "commit" as the start of a line (as this commit does). Make patman a little more robust. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2013-04-08patman: Provide option to ignore bad aliasesSimon Glass
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: Ignore all Gerrit Commit-* tagsSimon Glass
These tags are used by Gerrit, so let's ignore all of them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-04patman: Minor help message/README fixesSimon Glass
A few of the help messages are not quite right, and there is a typo in the README. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-04patman: Fix the comment in CheckTags to mention multiple tagsSimon Glass
This comment is less than helpful. Since multiple tags are supported, add an example of how multiple tags work. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-04patman: Don't allow spaces in tagsSimon Glass
At present something like: Revert "arm: Add cache operations" will try to use Revert "arm as a tag. Clearly this is wrong, so fix it. If the revert is intended to be tagged, then the tag can come before the revert, perhaps. Alternatively the 'Cc' tag can be used in the commit messages. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Doug Anderson <dianders@chromium.org>
2013-04-04patman: Fix up checkpatch parsing to deal with 'CHECK' linesSimon Glass
checkpatch has a new type of warning, a 'CHECK'. At present patman fails with these, which makes it less than useful. Add support for checks, making it backwards compatible with the old checkpatch. At the same time, clean up formatting of the CheckPatches() output, fix erroneous "internal error" if multiple patches have warnings and be more robust to new types of problems. 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 Glass
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-04-04patman: Allow specifying the message ID your series is in reply toDoug Anderson
Some versions of git don't seem to prompt you for the message ID that your series is in reply to. Allow specifying this from the command line. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>