Skip to contentSkip to conversation

ez: Fix 'trailers -F' used on a single commit

PATCH Applied Rob Herring 2 participants 2 messages Mar 30, 2023 – May 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ez: Fix 'trailers -F' used on a single commit

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.

---
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(+)
b4/ez.py +2 -0
index cf8759015f29..1a9abd642623 100644
@@ -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.')
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · Rob Herring

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.

[...]

Applied, thanks!

[1/1] ez: Fix 'trailers -F' used on a single commit

      commit: 3151f4267ec4c711db47c14c3460e36b8d3d05b3

Best regards,

Signature · 1 line
Konstantin Ryabitsev <[email protected]>