aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Blain <levraiphilippeblain@gmail.com>2023-02-21 20:07:46 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2023-03-03 14:56:20 -0500
commit1a8daaa8d8e3ae6e9b95d90f026009bf3ee8b65c (patch)
treeb1e9bb4b17d97668ea10e1c00cfb51a1bb1de6a0
parentada3021c64dd484e53219eb3af55da6c8f25d0ec (diff)
downloadb4-1a8daaa8d8e3ae6e9b95d90f026009bf3ee8b65c.tar.gz
ez: get_series_details: correctly compute 'base_commit' for all strategies
In f0fad6e (ez: refactor based on initial feedback, 2022-07-20), support was added for the 'branch-description' strategy, but 'get_series_details' was not changed to account for the fact that if the cover letter is stored in the branch description, base_commit and start_commit should be the same commit. This was also missed when 9e95d52 (ez: implement tip-commit strategy, 2022-07-27) added support for the 'tip-commit' strategy and changed get_series_details to adjust the end commit of the series. Fix that by setting 'base_commit' to 'start_commit's parent only for the 'commit' strategy, and to 'start_commit' for other strategies. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Link: https://msgid.link/20230221-fix-base-commit-for-non-commit-strategies-v1-1-0e31f1333d76@gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ez.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/b4/ez.py b/b4/ez.py
index 74afddc..5f4d744 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -940,10 +940,13 @@ def get_addresses_from_cmd(cmdargs: List[str], msgbytes: bytes) -> List[Tuple[st
def get_series_details(start_commit: Optional[str] = None) -> Tuple[str, str, str, List[str], str, str]:
if not start_commit:
start_commit = get_series_start()
- gitargs = ['rev-parse', f'{start_commit}~1']
- lines = b4.git_get_command_lines(None, gitargs)
- base_commit = lines[0]
strategy = get_cover_strategy()
+ if strategy == 'commit':
+ gitargs = ['rev-parse', f'{start_commit}~1']
+ lines = b4.git_get_command_lines(None, gitargs)
+ base_commit = lines[0]
+ else:
+ base_commit = start_commit
if strategy == 'tip-commit':
cover_commit = find_cover_commit()
endrange = b4.git_revparse_obj(f'{cover_commit}~1')