tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* Better error message when trying to use auto-to-cc on an empty branch
@ 2023-01-12  4:51 Peter Foley
  0 siblings, 0 replies; only message in thread
From: Peter Foley @ 2023-01-12  4:51 UTC (permalink / raw)
  To: tools

Hi,

I was poking around at
https://people.kernel.org/monsieuricon/sending-a-kernel-patch-with-b4-part-1
and ran into a corner case.

I had an existing commit that I wanted to try out b4 with, so I ran
"b4 prep -n kconfig" on top of the commit.
I then immediately ran b4 prep -c and got this:
b4 prep -c
Will collect To: addresses using get_maintainer.pl
Will collect Cc: addresses using get_maintainer.pl
Traceback (most recent call last):
  File "/home/peter/.local/bin/b4", line 8, in <module>
    sys.exit(cmd())
  File "/home/peter/.local/lib/python3.10/site-packages/b4/command.py",
line 359, in cmd
    cmdargs.func(cmdargs)
  File "/home/peter/.local/lib/python3.10/site-packages/b4/command.py",
line 76, in cmd_prep
    b4.ez.cmd_prep(cmdargs)
  File "/home/peter/.local/lib/python3.10/site-packages/b4/ez.py",
line 1902, in cmd_prep
    return auto_to_cc()
  File "/home/peter/.local/lib/python3.10/site-packages/b4/ez.py",
line 1824, in auto_to_cc
    tos, ccs, tag_msg, patches = get_prep_branch_as_patches()
  File "/home/peter/.local/lib/python3.10/site-packages/b4/ez.py",
line 1143, in get_prep_branch_as_patches
    patches = b4.git_range_to_patches(None, start_commit, 'HEAD',
  File "/home/peter/.local/lib/python3.10/site-packages/b4/__init__.py",
line 2766, in git_range_to_patches
    raise RuntimeError(f'Could not run rev-list {start}..{end}')
RuntimeError: Could not run rev-list
17d982ccd4b5d7b274578eec3ca5d903de594d77..HEAD

I eventually figured out that the problem was the commit order (the
cover letter should have been the ancestor of my commit), so I was
able to just git rebase -i and swap the two commits. At that point
things worked fine, but it would be nice if the error message was a
little more obvious.

Reporting here per the request on
https://b4.docs.kernel.org/en/latest/index.html

Thanks,

Peter Foley

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-12  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12  4:51 Better error message when trying to use auto-to-cc on an empty branch Peter Foley

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).