Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org
Subject: [PATCH 2/2] am: Allow specifying a base to check applying series
Date: Fri, 18 Jun 2021 12:24:52 -0600	[thread overview]
Message-ID: <20210618182452.2577871-2-robh@kernel.org> (raw)
In-Reply-To: <20210618182452.2577871-1-robh@kernel.org>

Add a new option, '--check-base', to allow the user to specify a specific
base git ref to check applying a series to.

Signed-off-by: Rob Herring <robh@kernel.org>
---
I'm wondering if this should take a list (in order of preference) instead.
If so, then the 'Base: ...' message should be reworked to be easier to
parse which base was found.
---
 b4/command.py | 2 ++
 b4/mbox.py    | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/b4/command.py b/b4/command.py
index 2d6994dd5111..2d48dafa21f7 100644
--- a/b4/command.py
+++ b/b4/command.py
@@ -120,6 +120,8 @@ def cmd():
                             '"-P *globbing*" to match on commit subject)')
     sp_am.add_argument('-g', '--guess-base', dest='guessbase', action='store_true', default=False,
                        help='Try to guess the base of the series (if not specified)')
+    sp_am.add_argument('-b', '--check-base', dest='checkbase', default='HEAD',
+                       help='Check if series applies to specified ref base (HEAD if not specified)')
     sp_am.add_argument('-3', '--prep-3way', dest='threeway', action='store_true', default=False,
                        help='Prepare for a 3-way merge '
                             '(tries to ensure that all index blobs exist by making a fake commit range)')
diff --git a/b4/mbox.py b/b4/mbox.py
index e722d05a79aa..c660fb45fb36 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -234,9 +234,9 @@ def make_am(msgs, cmdargs, msgid):
     else:
         cleanmsg = ''
         if topdir is not None:
-            checked, mismatches = lser.check_applies_clean(topdir)
+            checked, mismatches = lser.check_applies_clean(topdir, cmdargs.checkbase)
             if mismatches == 0 and checked != mismatches:
-                cleanmsg = ' (applies clean to current tree)'
+                cleanmsg = ' (applies clean to %s)' % cmdargs.checkbase
             elif cmdargs.guessbase:
                 # Look at the last 10 tags and see if it applies cleanly to
                 # any of them. I'm not sure how useful this is, but I'm going
-- 
2.27.0


  reply	other threads:[~2021-06-18 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 18:24 [PATCH 1/2] check_applies_clean: Don't append '.git' repeatedly Rob Herring
2021-06-18 18:24 ` Rob Herring [this message]
2021-06-21 20:03   ` [PATCH 2/2] am: Allow specifying a base to check applying series Konstantin Ryabitsev
2021-06-21 23:07     ` Rob Herring
2021-06-22 14:23       ` Konstantin Ryabitsev
2021-06-21 20:02 ` [PATCH 1/2] check_applies_clean: Don't append '.git' repeatedly Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210618182452.2577871-2-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox