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] ez: Fix 'trailers -F' used on a single commit
Date: Thu, 30 Mar 2023 15:15:29 -0500	[thread overview]
Message-ID: <20230330201529.2744290-1-robh@kernel.org> (raw)

Running 'b4 trailers -u -F <msgid>' on a single commit fails:

CRITICAL: Failed to convert range to patches: Could not run rev-list None~1..409ee53c38a1d9a60e76ffa92088cfad07cea850

The problem is the loop is exited after 1 iteration and prevcommit is never
set.

Signed-off-by: Rob Herring <robh@kernel.org>
---
I think a base commit option and/or use upstream tracking branch is needed
here. There's probably cases where one wants to apply trailers and they
are not the author.
---
 b4/ez.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/b4/ez.py b/b4/ez.py
index cf8759015f29..1a9abd642623 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -834,6 +834,8 @@ def update_trailers(cmdargs: argparse.Namespace) -> None:
                 break
             prevparent = parent
             prevcommit = commit
+        if prevcommit is None:
+            prevcommit = end
         start = f'{prevcommit}~1'
     else:
         logger.critical('CRITICAL: Please specify -F msgid to look up trailers from remote.')
-- 
2.39.2


             reply	other threads:[~2023-03-30 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 20:15 Rob Herring [this message]
2023-05-26 18:23 ` [PATCH] ez: Fix 'trailers -F' used on a single commit 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=20230330201529.2744290-1-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).