From: Simon Glass Date: Wed, 24 Aug 2016 10:51:46 -0600 Subject: [U-Boot] [PATCH 02/42] moveconfig: Add an option to commit changes In-Reply-To: <1472057546-10360-1-git-send-email-sjg@chromium.org> References: <1472057546-10360-1-git-send-email-sjg@chromium.org> Message-ID: <1472057546-10360-3-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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