| Age | Commit message (Collapse) | Author |
|
Add a -b option to allow patches to be created from a branch other than
the current one.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
Only a few members of this class are used and only in a test. To avoid
importing the module, convert the test to use a dict.
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Stefan Bosch <[email protected]>
|
|
The checkpatch module is not used, so drop it.
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Stefan Bosch <[email protected]>
|
|
Some mailing lists have size limits and when we add binary contents
to our patches it's easy to exceed the size limits.
Git supports a command line option "--no-binary" to generate patches
without any binary contents. Add an option in patman to handle this.
Note with this option patches cannot be applied properly, but they
are still useful for code review.
Signed-off-by: Bin Meng <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
s/Subprocress/Subprocess/
s/easiler/easier/
s/repositiory/repository/
s/rangem/range/
s/Retruns/Returns/
Signed-off-by: Anatolij Gustschin <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Use the new functions in the tools module to handle conversion.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
Update all print statements to be functions, as required by Python 3.
Signed-off-by: Simon Glass <[email protected]>
|
|
At present this function uses lists and strings. This does not work so
well with Python 3, and testing against '' does not work for a bytearray.
Update the code to fix these issues.
Signed-off-by: Simon Glass <[email protected]>
|
|
Some environments require providing the '--smtp-server' argument to
'git send-email'. Add support for this.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
This is not a good variable name in Python because 'str' is a type. It
shows up highlighted in some editors. Rename it.
Signed-off-by: Simon Glass <[email protected]>
Tested-by: Philipp Tomsich <[email protected]>
|
|
Don't mess with the email address when outputting them. Just make sure
they are encoded with utf-8.
Signed-off-by: Simon Glass <[email protected]>
Tested-by: Philipp Tomsich <[email protected]>
|
|
Syntax for exception handling is a little more strict in python 3.x.
Convert all uses to a form accepted by both python 2.x & python 3.x.
Signed-off-by: Paul Burton <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
It is more useful to have this method raise an error when something goes
wrong. Make this the default and adjust the few callers that don't want to
use it this way.
Signed-off-by: Simon Glass <[email protected]>
|
|
At present if you try to use buildman with the branch 'test' it will
complain that it is unsure whether you mean the branch or the directory.
This is a feature of the 'git log' command that buildman uses. Fix it
by resolving the ambiguity.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Joe Hershberger <[email protected]>
|
|
Add option to create threaded series of patches.
With it, it will be possible to create patch threads like this:
[PATCH 0/10] Add support for time travel
[PATCH 1/10] Add Flux Capacitor driver
[PATCH 2/10] Add Mr. Fusion driver
(...)
Internally it will call git send-email with --thread option
Signed-off-by: Mateusz Kulikowski <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
This reverts commit 19b4a3369876f9215e2b861f211e8df1a75e26ca.
Since that commit, patman generates useless patches for file removal;
"git format -D" prints only the header but not the diff when deleting
files, and "git am" always refuses such patches.
The following is the quotation from "man git-format-patch":
-D, --irreversible-delete
Omit the preimage for deletes, i.e. print only the header but
not the diff between the preimage and /dev/null. The resulting
patch is not meant to be applied with patch nor git apply; this
is solely for people who want to just concentrate on reviewing
the text after the change. In addition, the output obviously
lack enough information to apply such a patch in reverse, even
manually, hence the name of the option.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
This allows Patman to generate smaller patches for file removal.
Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Simon Glass <[email protected]>
Acked-by: Heiko Schocher <[email protected]>
|
|
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 <[email protected]>
Acked-by: Simon Glass <[email protected]>
Tested-by: Simon Glass <[email protected]>
|
|
This causes an error when trying to build a local branch which has a local
branch as its upstream.
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Masahiro Yamada <[email protected]>
|
|
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 <[email protected]>
Acked-by: Simon Glass <[email protected]>
Tested-by: Simon Glass <[email protected]>
|
|
Adjust the -b flag to permit a range expression as well as a branch.
Signed-off-by: Simon Glass <[email protected]>
Suggested-by: Daniel Schwierzeck <[email protected]>
Tested-by: Daniel Schwierzeck <[email protected]>
|
|
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 <[email protected]>
Suggested-by: Wolfgang Denk <[email protected]>
|
|
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 <[email protected]>
|
|
A missing 'global' declaration means that this feature does not currently
work. Fix it.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
This option is currently not supported, but needs to be, for buildman to
operate as expected.
Reported-by: York Sun <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
|
|
Move the code that builds a 'git log' command into a function so we can more
easily adjust it.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 = [email protected]
in their .git/config because the 'To: [email protected]' field
should always be added when sending patches.
That seems more reasonable rather than adding
'Series-to: [email protected]' to every patch series.
Patman should exit only when both Series-to tag and sendemail.to
configuration are mising.
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Simon Glass <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
|
|
This sort of failure is rare, but the code to deal with it is wrong.
Fix it.
Signed-off-by: Simon Glass <[email protected]>
|
|
Signed-off-by: Wolfgang Denk <[email protected]>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <[email protected]>
|
|
Rather than a backtrace, produce a nice error message when an invalid
branch is provided to buildman.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Doug Anderson <[email protected]>
|
|
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 <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
Add methods to find out the commits in a branch, clone a repo and
fetch from a repo.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
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 <[email protected]>
|
|
This patch adds support for a [settings] section in the .patman file.
In this section you can add settings that will affect the default
values for command-line options.
Support is added in a generic way such that any setting can be updated
by just referring to the "dest" of the option that is passed to the
option parser. At the moment options that would make sense to put in
settings are "ignore_errors", "process_tags", and "verbose". You
could override them like:
[settings]
ignore_errors: True
process_tags: False
verbose: True
The settings functionality is also used in a future change which adds
support for per-project settings.
Signed-off-by: Doug Anderson <[email protected]>
|
|
Several of the patman doctests assume that patman was run with:
./patman
Fix them so that they work even if patman is run with just "patman"
(because patman is in the path).
Signed-off-by: Doug Anderson <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
Colored logs confuse patman when analyzing logs.
Add --no-color option in git log commands in case
the default config has color.
Signed-off-by: Albert ARIBAUD <[email protected]>
Acked-by: Simon Glass <[email protected]>
Signed-off-by: Tom Rini <[email protected]>
|
|
patman shouts when it couldn't find a $(HOME)/.patman file.
Handle it in a sane way by creating a new one for the user.
It looks for a user.name and user.email in the global .gitconfig
file, waits for the user input if it can't find there. Update the
same in the README
Signed-off-by: Vikram Narayanan <[email protected]>
Acked-by: Simon Glass <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Wolfgang Denk <[email protected]>
|