| Age | Commit message (Collapse) | Author |
|
Patman allows defaults for its command-line flags to be read from a
file. The implementation of this does not fully work with subcommands,
since we don't want a default for those.
Also, it relies on being able to parse any sort of cmdline in order to
figure out the options that are available. But in some cases, the
cmdline may not parse, e.g. if there are required options, or
conflicting options.
Add a class which can be safely used to parse any cmdline, since it
allows execution to continue even when errors are obtained. Use this to
determine the defaults, being careful to skip sub/commands.
Another way to handle all of this would be to maintain the defaults
separately and insert them into the parser manually. For now, I'm not
sure which is best.
Signed-off-by: Simon Glass <[email protected]>
|
|
When running tests where the .git directory is not owned by the current
user, various warnings are produced and the tests fail. This happens in
CI.
For patman itself, modify the gitutil.get_top_level() function to return
None in this case. Ensure that the warning is not shown, since it creates
about 1000 lines of output.
For checkpatch, the same warning is produced even though --no-tree is
given. Suppress that as well.
Signed-off-by: Simon Glass <[email protected]>
|
|
Tests may want to parse their own arguments. Refactor the parser code to
support this and allow settings to receive arguments as well.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
The method `ConfigParser.readfp()` is marked deprecated[1].
In Python 3.12 this method have been removed, so replace it with
`ConfigParser.read_file()`.
[1] https://docs.python.org/3.11/library/configparser.html#configparser.ConfigParser.readfp
Signed-off-by: Brandon Maier <[email protected]>
CC: Simon Glass <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
This enables versioning a project specific patman configuration file.
It also makes it possible to declare the project name, which is not a
useful thing to do in $HOME/.patman. A new test is added, along
updated documentation.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Rationale: if the user explicitly provide this argument, they probably
intend for it to be used.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
This better matches Python conventions, allowing to easily test
whether the optional argument is provided.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Instead of propagating it from the module entry point (main script).
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
The SafeConfigParser class has been renamed in Python 3.2 to
ConfigParser, and the old alias has been deprecated since.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Remove extraneous imports, variables and comply to PEP 8 maximum line
width, among other PEP 8 changes suggested by Pyflake.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
On python 3.8.10 (and 3.10), subparsers are not updated with defaults. I
suspect this is related to [1]. Fix this by explicitly updating
subparsers with settings.
[1] https://github.com/python/cpython/issues/89398
Fixes: 3145b63513 ("patman: Update defaults in subparsers")
Signed-off-by: Sean Anderson <[email protected]>
Reviewed-by: Alper Nebi Yasak <[email protected]>
Tested-by: Alper Nebi Yasak <[email protected]>
|
|
Fix pylint errors that can be fixed and mask those that seem to be
incorrect.
Signed-off-by: Simon Glass <[email protected]>
|
|
Convert this file to snake case and update all files which use it.
Signed-off-by: Simon Glass <[email protected]>
|
|
Add defaults for FSF/GNU projects, such as gcc, that provide sensible
settings for those projects.
Signed-off-by: Philipp Tomsich <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
At present values from the settings file are only applied to the main
parser. With the new parser structure this means that some settings are
ignored.
Update the implementation to set defaults across the main parser and all
subparsers. Also fix up the comments, since ArgumentParser is being used
now.
Signed-off-by: Simon Glass <[email protected]>
|
|
Convert from OptionParser to ArgumentParser to match binman. With this we
can easily add sub-commands.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
Convert from OptionParser to ArgumentParser to match binman. With this we
can easily add sub-commands.
Signed-off-by: Simon Glass <[email protected]>
|
|
Pass this module in so that settings does not need to import it.
Signed-off-by: Simon Glass <[email protected]>
Reported-by: Stefan Bosch <[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]>
|
|
We can rely on Python 3 now, so drop the workaround for importing
StringIO.
Signed-off-by: Simon Glass <[email protected]>
|
|
We don't need these now that the tools using Python 3. Drop them.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
The unicode type does not exist in Python 3 and when displaying strings
they do not have the 'u' prefix. Adjusts the settings unit tests to deal
with this difference, by converting the comparison value to a string, thus
dropping the 'u'.
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]>
|
|
Python 3 requires this, and Python 2 allows it. Convert the code over to
ensure compatibility with Python 3.
Signed-off-by: Simon Glass <[email protected]>
|
|
With Python 2.7.15rc1, ConfigParser.SafeConfigParser has unfortunately
started returning unicode, for unknown reasons. Adjust the code to handle
this by converting everything to unicode. We cannot convert things to
ASCII since email addresses may be encoded with UTF-8.
Signed-off-by: Simon Glass <[email protected]>
|
|
Previously the first three words in a git-mailrc alias entry could only
be separated by spaces. git-send-email and Mutt both allow arbitrary
whitespace here.
Signed-off-by: Adam Sampson <[email protected]>
Reviewed-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 section of the settings file may be missing. Handle that gracefully
rather than emitting an error.
Also update patman to write this section when a new settings file is
created.
Fixes: e11aa602 (patman: add support for omitting bouncing addresses)
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Chris Packham <[email protected]>
Tested-by: Bin Meng <[email protected]>
|
|
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Philipp Tomsich <[email protected] <mailto:[email protected]>>
|
|
In python 3.x StringIO is no longer a module, and the class can instead
be found in the io module. Adjust the code in the doctest input to
account for both.
Signed-off-by: Paul Burton <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
In python 3.x the iteritems() method has been removed from dictionaries,
and the items() method does effectively the same thing. On python 2.x
using items() is a little less efficient since it involves copying data,
but as speed isn't a concern in this code switch to using items() anyway
for simplicity.
Signed-off-by: Paul Burton <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
In python 3.x module names used in import statements are case sensitive,
and the configparser module is named in all lower-case. Import it as such
in order to avoid errors when running with 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]>
|
|
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 <[email protected]>
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]>
|
|
There are cases that we want to support different settings (or maybe
even different aliases) for different projects. Add support for this
by:
* Adding detection for two big projects: U-Boot and Linux.
* Adding default settings for Linux (U-Boot is already good with the
standard patman defaults).
* Extend the new "settings" feature in .patman to specify per-project
settings.
Signed-off-by: Doug Anderson <[email protected]>
Acked-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]>
|
|
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]>
|
|
Move the config file from ~/.config/patman to ~/.patman as it is
more appropriate to have it there. Update the same in the README.
Signed-off-by: Vikram Narayanan <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Wolfgang Denk <[email protected]>
Acked-by: Simon Glass <[email protected]>
|
|
What is this?
=============
This tool is a Python script which:
- Creates patch directly from your branch
- Cleans them up by removing unwanted tags
- Inserts a cover letter with change lists
- Runs the patches through checkpatch.pl and its own checks
- Optionally emails them out to selected people
It is intended to automate patch creation and make it a less
error-prone process. It is useful for U-Boot and Linux work so far,
since it uses the checkpatch.pl script.
It is configured almost entirely by tags it finds in your commits.
This means that you can work on a number of different branches at
once, and keep the settings with each branch rather than having to
git format-patch, git send-email, etc. with the correct parameters
each time. So for example if you put:
in one of your commits, the series will be sent there.
See the README file for full details.
END
Signed-off-by: Simon Glass <[email protected]>
|