[U-Boot] [PATCH 02/42] moveconfig: Add an option to commit changes
Simon Glass
sjg at chromium.org
Wed Aug 24 18:51:46 CEST 2016
The moveconfig tool is quite clever and generally produces results that
are suitable for sending as a patch without further work. The main required
step is to add the changes to a commit.
Add an option to do this automatically. This allows moveconfig to be used
from a script to convert multiple CONFIG options, once per commit.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
tools/moveconfig.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 290270a..cf21318 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -1199,6 +1199,8 @@ def main():
# Add options here
parser.add_option('-c', '--color', action='store_true', default=False,
help='display the log in color')
+ parser.add_option('-C', '--commit', action='store_true', default=False,
+ help='Create a git commit for the operation')
parser.add_option('-d', '--defconfigs', type='string',
help='a file containing a list of defconfigs to move')
parser.add_option('-n', '--dry-run', action='store_true', default=False,
@@ -1242,5 +1244,13 @@ def main():
cleanup_headers(configs, options)
cleanup_extra_options(configs, options)
+ if options.commit:
+ os.system('git add -u')
+ msg = '''Convert %s to Kconfig
+
+Move this option to Kconfig and tidy up existing uses.
+''' % ', '.join(configs)
+ os.system('git commit -s -m "%s"' % msg)
+
if __name__ == '__main__':
main()
--
2.8.0.rc3.226.g39d4020
More information about the U-Boot
mailing list