Skip to content
Snippets Groups Projects
Commit 9ede2123 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

moveconfig: Add an option to commit changes


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: default avatarSimon Glass <sjg@chromium.org>
parent 6b403dfd
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,10 @@ Available options ...@@ -122,6 +122,10 @@ Available options
Surround each portion of the log with escape sequences to display it Surround each portion of the log with escape sequences to display it
in color on the terminal. in color on the terminal.
-C, --commit
Create a git commit with the changes when the operation is complete. A
standard commit message is used which may need to be edited.
-d, --defconfigs -d, --defconfigs
Specify a file containing a list of defconfigs to move Specify a file containing a list of defconfigs to move
...@@ -1240,6 +1244,8 @@ def main(): ...@@ -1240,6 +1244,8 @@ def main():
# Add options here # Add options here
parser.add_option('-c', '--color', action='store_true', default=False, parser.add_option('-c', '--color', action='store_true', default=False,
help='display the log in color') 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', parser.add_option('-d', '--defconfigs', type='string',
help='a file containing a list of defconfigs to move') help='a file containing a list of defconfigs to move')
parser.add_option('-n', '--dry-run', action='store_true', default=False, parser.add_option('-n', '--dry-run', action='store_true', default=False,
...@@ -1285,5 +1291,17 @@ def main(): ...@@ -1285,5 +1291,17 @@ def main():
cleanup_headers(configs, options) cleanup_headers(configs, options)
cleanup_extra_options(configs, options) cleanup_extra_options(configs, options)
if options.commit:
subprocess.call(['git', 'add', '-u'])
if configs:
msg = 'Convert %s %sto Kconfig' % (configs[0],
'et al ' if len(configs) > 1 else '')
msg += ('\n\nThis converts the following to Kconfig:\n %s\n' %
'\n '.join(configs))
else:
msg = 'configs: Resync with savedefconfig'
msg += '\n\nRsync all defconfig files using moveconfig.py'
subprocess.call(['git', 'commit', '-s', '-m', msg])
if __name__ == '__main__': if __name__ == '__main__':
main() main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment