diff mbox

[U-Boot,1/3] moveconfig: Allow piping in 'git show --stat' output

Message ID 20170616033933.21607-2-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass June 16, 2017, 3:39 a.m. UTC
It is useful to be able to process only a subset of boards to save time.
Often that subset is defined by the defconfig files in a git commit. This
change allows things like:

   # Build the database
   ./tools.moveconfig.py -b

   # Find some implying configs
   ./tools/moveconfig.py -i CONFIG_X

   # Add some 'imply' statements to Kconfig files
   ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B

   # Reprocess the defconfig files to see if we can drop some changes
   git show --stat | ./tools/moveconfig.py -s -d -

   # Update the commit, with fewer defconfig changes
   gii commit -au

Where the commit contains defconfig files, this will reprocess them to
take account of the imply statements that you added.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/moveconfig.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Glass July 6, 2017, 2:51 p.m. UTC | #1
It is useful to be able to process only a subset of boards to save time.
Often that subset is defined by the defconfig files in a git commit. This
change allows things like:

   # Build the database
   ./tools.moveconfig.py -b

   # Find some implying configs
   ./tools/moveconfig.py -i CONFIG_X

   # Add some 'imply' statements to Kconfig files
   ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B

   # Reprocess the defconfig files to see if we can drop some changes
   git show --stat | ./tools/moveconfig.py -s -d -

   # Update the commit, with fewer defconfig changes
   gii commit -au

Where the commit contains defconfig files, this will reprocess them to
take account of the imply statements that you added.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/moveconfig.py | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index 09c5a7e5cd..4295b47d7c 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -405,6 +405,8 @@  def get_matched_defconfigs(defconfigs_file):
         line = line.strip()
         if not line:
             continue # skip blank lines silently
+        if ' ' in line:
+            line = line.split(' ')[0]  # handle 'git log' input
         matched = get_matched_defconfig(line)
         if not matched:
             print >> sys.stderr, "warning: %s:%d: no defconfig matched '%s'" % \