diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-12-16 11:15:59 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-12-16 11:15:59 -0500 |
commit | 07c988b2217ac42c7e29cfd321d68c45a4e4b3ef (patch) | |
tree | 5d417edd430851fbeb9f04762960fc0def5fb482 | |
parent | 40386e66ce0effbb0d35127b222961c19dee12a1 (diff) | |
download | b4-07c988b2217ac42c7e29cfd321d68c45a4e4b3ef.tar.gz |
Recognize merged PRs when attempting auto-base
When we come across a pull request that doesn't list its base (i.e. not
generated using git-request-pull), we try to figure out the base
ourselves by doing merge-base. However, if the pull request is already
merged, then that is going to be a useless operation, so recognize this
situation and bail out early.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/pr.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -255,6 +255,9 @@ def explode(gitdir, lmsg, mailfrom=None, retrieve_links=True, fpopts=None): logger.critical(out) raise RuntimeError('Could not find common ancestry') lmsg.pr_base_commit = out.strip() + if lmsg.pr_base_commit == lmsg.pr_tip_commit: + logger.critical('Cannot auto-discover merge-base on a merged pull request.') + raise RuntimeError('Cannot find merge-base on a merged pull request') logger.info('Generating patches starting from the base-commit') @@ -461,6 +464,7 @@ def main(cmdargs): try: msgs = explode(tc, lmsg, mailfrom=cmdargs.mailfrom, retrieve_links=cmdargs.getlinks) except RuntimeError: + logger.critical('Nothing exploded.') sys.exit(1) if msgs: |