summaryrefslogtreecommitdiffstats
path: root/tools/patman
Commit message (Collapse)AuthorAgeFilesLines
* patman: Add a -m option to avoid copying the maintainersSimon Glass2014-09-213-5/+12
| | | | | | | | | 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>
* patman: make run results better visibleVadim Bendebury2014-09-091-1/+6
| | | | | | | | | | | | | | | | 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>
* buildman: Ignore conflicting tagsSimon Glass2014-09-091-1/+3
| | | | | | | | | | | 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>
* patman: Start with a clean series when neededSimon Glass2014-09-091-1/+3
| | | | | | | | | | | 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>
* patman: Provide a way to intercept commands for testingSimon Glass2014-09-091-0/+20
| | | | | | | | | | 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>
* patman: RunPipe() should not pipe stdout/stderr unless askedSimon Glass2014-09-092-3/+7
| | | | | | | 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>
* patman: Add a way of recording terminal output for testingSimon Glass2014-09-091-0/+72
| | | | | | | | 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>
* patman: Fix detection of git versionSimon Glass2014-09-051-0/+2
| | | | | | | A missing 'global' declaration means that this feature does not currently work. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Avoid changing the order of tagsSimon Glass2014-09-051-13/+1
| | | | | | | | | | 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>
* patman: Use --no-pager' to stop git from forking a pagerSimon Glass2014-09-051-1/+1
| | | | | | | | 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>
* patman: Remove the -a optionSimon Glass2014-09-052-95/+0
| | | | | | | | | 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>
* patman: Correct unit tests to run correctlySimon Glass2014-09-054-14/+22
| | | | | | | | | | 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>
* patman: Fix indentation in terminal.pySimon Glass2014-09-051-53/+55
| | | | | | | This code came from a different project with 2-character indentation. Fix it for U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Support the 'reverse' option for 'git log'Simon Glass2014-08-281-0/+2
| | | | | | | | 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>
* patman: refactor help messageMasahiro Yamada2014-08-221-1/+1
| | | | | | | | | "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>
* tools, scripts: refactor error-out statements of Python scriptsMasahiro Yamada2014-08-212-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* patman: Only use git's --no-decorate when availableSimon Glass2014-08-131-1/+8
| | | | | | | | 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>
* patman: Move the 'git log' command into a functionSimon Glass2014-08-132-13/+31
| | | | | | | 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>
* patman: make "No recipient" checking more tolerantMasahiro Yamada2014-07-281-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* patman: Only apply patches when we know the original HEADSimon Glass2014-07-071-0/+4
| | | | | | | | | | | | | | 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>
* patman: Suppress duplicate signoffs only for real patchesSimon Glass2014-05-161-1/+2
| | | | | | | | | | | | | 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>
* patman: Avoid duplicate sign-offsSimon Glass2014-05-093-2/+23
| | | | | | | Keep track of all Signed-off-by tags in a commit and silently suppress any duplicates. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Deal with 'git apply' failures correctlySimon Glass2014-05-091-2/+4
| | | | | | | 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>
* patman: Use Patch-cc: instead of Cc:Simon Glass2014-03-222-11/+14
| | | | | | | | | | | | | 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>
* patman: add Commit-notes tag and sectionAlbert ARIBAUD2013-11-213-8/+47
| | | | | | | | | | | | | | 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)
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-2413-239/+15
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* patman: README documentation nits (unit test)Gerhard Sittig2013-07-151-4/+4
| | | | | | | | | | 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>
* buildman: Produce a sensible error message when branch is missingSimon Glass2013-05-141-6/+15
| | | | | | | 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>
* patman: Do not hardcode python pathMichal Simek2013-05-091-1/+1
| | | | | | | | | | | | 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>
* buildman: Allow conflicting tags to avoid spurious errorsSimon Glass2013-05-091-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>
* patman: fix gitutil for decorationsAndreas Bießmann2013-04-182-4/+7
| | | | | | | | | 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>
* patman: Add Series-process-log tag to sort/uniq change logsSimon Glass2013-04-083-4/+16
| | | | | | | | | | | | | | 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>
* patman: Add -a option to refrain from test-applying the patchesSimon Glass2013-04-081-3/+7
| | | | | | | | | | 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>
* patman: Don't barf if the word 'commit' starts a lineDoug Anderson2013-04-081-1/+1
| | | | | | | | | | | 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>
* patman: Provide option to ignore bad aliasesSimon Glass2013-04-083-24/+61
| | | | | | | | | | | | | | | 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>
* patman: Ignore all Gerrit Commit-* tagsSimon Glass2013-04-041-1/+1
| | | | | | | 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>
* patman: Minor help message/README fixesSimon Glass2013-04-042-3/+3
| | | | | | | | 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>
* patman: Fix the comment in CheckTags to mention multiple tagsSimon Glass2013-04-041-2/+3
| | | | | | | | 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>
* patman: Don't allow spaces in tagsSimon Glass2013-04-041-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* patman: Fix up checkpatch parsing to deal with 'CHECK' linesSimon Glass2013-04-042-62/+112
| | | | | | | | | | | | | | | 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>
* patman: Add Cover-letter-cc tag to Cc cover letter to peopleSimon Glass2013-04-043-4/+27
| | | | | | | | | | | | 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>
* patman: Allow specifying the message ID your series is in reply toDoug Anderson2013-04-042-2/+9
| | | | | | | | | 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>
* patman: Make "Reviewed-by" an important tagDoug Anderson2013-04-042-4/+4
| | | | | | | | | | Although "Reviewed-by:" is a tag that gerrit adds, it's also a tag used by upstream. Stripping it is undesirable. In fact, we should treat it as important. Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Simon Glass <sjg@chromium.org>
* patman: Add additional git utiltiesSimon Glass2013-04-041-1/+123
| | | | | | | Add methods to find out the commits in a branch, clone a repo and fetch from a repo. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow reading metadata from a list of commitsSimon Glass2013-04-041-7/+29
| | | | | | | | We normally read from the current branch, but buildman will need to look at commits from another branch. Allow the metadata to be read from any list of commits, to provide this flexibility. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow commands to raise on error, or notSimon Glass2013-04-042-7/+13
| | | | | | | | Make raise_on_error a parameter so that we can control which commands raise and which do not. If we get an error reading the alias file, just continue. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Make command methods return a CommandResultSimon Glass2013-04-043-24/+64
| | | | | | | | Rather than returning a list of things, return an object. That makes it easier to access the returned items, and easier to extend the return value later. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add cros_subprocess library to manage subprocessesSimon Glass2013-04-041-0/+397
| | | | | | | | | | | | | This adds a new library on top of subprocess which permits access to the subprocess output as it is being generated. We can therefore give the illusion that a process is running independently, but still monitor its output so that we know what is going on. It is possible to display output on a terminal as it is generated (a little like tee). The supplied output function is called with all stdout/stderr data as it arrives. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Use bright ANSI colours by defaultSimon Glass2013-04-041-8/+11
| | | | | | | Rather than the rather dull colours, use bright versions which normally look better and are easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Use ANSI colours only when outputting to a terminalSimon Glass2013-04-041-2/+9
| | | | | | | | It is easy to detect whether or not the process is connected to a terminal, or piped to a file. Disable ANSI colours automatically when output is not to a terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud