tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Kernel.org Tools" <tools@linux.kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH b4 1/2] prep: Fix splat with --auto-to-cc when a branch has no commits
Date: Tue, 10 Jan 2023 15:46:07 -0600	[thread overview]
Message-ID: <20230110-prep-opts-v1-1-8e7d7b861849@kernel.org> (raw)
In-Reply-To: <20230110-prep-opts-v1-0-8e7d7b861849@kernel.org>

Running 'b4 prep -c' on a branch with no commits will splat. Print a
friendly message instead.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 b4/ez.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/b4/ez.py b/b4/ez.py
index 36f935ebe993..1b7e390b7744 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -1819,7 +1819,12 @@ def auto_to_cc() -> None:
             logger.debug('added %s to seen', ltr.addr[1])
             extras.append(ltr)
 
-    tos, ccs, tag_msg, patches = get_prep_branch_as_patches()
+    try:
+        tos, ccs, tag_msg, patches = get_prep_branch_as_patches()
+    except RuntimeError:
+        logger.info('No commits in branch')
+        return
+
     logger.info('Collecting To/Cc addresses')
     # Go through the messages to make to/cc headers
     for commit, msg in patches:

-- 
2.39.0


  reply	other threads:[~2023-01-10 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 21:46 [PATCH b4 0/2] A prep splat fix and rework of option handling Rob Herring
2023-01-10 21:46 ` Rob Herring [this message]
2023-01-10 21:46 ` [PATCH b4 2/2] prep: Allow configuration options when enrolling/creating branch Rob Herring
2023-01-10 22:15 ` [PATCH b4 0/2] A prep splat fix and rework of option handling Rob Herring
2023-01-10 22:43   ` Konstantin Ryabitsev
2023-01-12 16:14 ` 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=20230110-prep-opts-v1-1-8e7d7b861849@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;
as well as URLs for NNTP newsgroup(s).