diff mbox series

Couple of b4 trailers issues

Message ID 2517d5cdff57048a13e85b9604957b73b69724c3.camel@kernel.org (mailing list archive)
State Accepted
Headers show
Series Couple of b4 trailers issues | expand

Commit Message

Vishal Verma Aug. 31, 2022, 5:19 p.m. UTC
I tried out the b4 trailers command, and found a couple of issues.

1. I get a traceback (attached at the end) if the tree contains
(recent?) merge commits. This patch fixes the splat, but I'm not sure
is the right solution - I didn't spend too much time on understanding
what the parent/commit/end checks were trying to do.

---

             if prevparent is None:

---

2. b4 trailers doesn't seem to respect the ordering from git config
b4.trailer-order


Traceback for #1:

$ b4 trailers -u -F 166188306499.3409478.15310054338186313752.stgit@dwillia2-xfh.jf.intel.com
Traceback (most recent call last):
  File "/home/vverma7/git/b4/b4/command.py", line 350, in <module>
    cmd()
  File "/home/vverma7/git/b4/b4/command.py", line 333, in cmd
    cmdargs.func(cmdargs)
  File "/home/vverma7/git/b4/b4/command.py", line 81, in cmd_trailers
    b4.ez.cmd_trailers(cmdargs)
  File "/home/vverma7/git/b4/b4/ez.py", line 1386, in cmd_trailers
    update_trailers(cmdargs)
  File "/home/vverma7/git/b4/b4/ez.py", line 652, in update_trailers
    commit, parent = line.split()
ValueError: too many values to unpack (expected 2)

Comments

Konstantin Ryabitsev Aug. 31, 2022, 7:23 p.m. UTC | #1
On Wed, Aug 31, 2022 at 11:19:12AM -0600, Vishal Verma wrote:
> 1. I get a traceback (attached at the end) if the tree contains
> (recent?) merge commits. This patch fixes the splat, but I'm not sure
> is the right solution - I didn't spend too much time on understanding
> what the parent/commit/end checks were trying to do.

Thank you for testing it out. I'll apply a fix shortly.

> 2. b4 trailers doesn't seem to respect the ordering from git config
> b4.trailer-order

That feature was gone for a while, but is now back in a new, chain-of-custody
respecting version. It should be in the latest master.

-K
diff mbox series

Patch

diff --git a/b4/ez.py b/b4/ez.py
index 8a1b8ed..27dc090 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -649,7 +649,9 @@  def update_trailers(cmdargs: argparse.Namespace) ->
None:
 
         prevparent = prevcommit = end = None
         for line in lines:
-            commit, parent = line.split()
+            hlist = line.split()
+            commit = hlist[0]
+            parent = hlist[1]
             if end is None:
                 end = commit