* [PATCH b4] ez: get_series_details: correctly compute 'base_commit' for all strategies
@ 2023-02-22 1:07 Philippe Blain
2023-03-03 20:00 ` Konstantin Ryabitsev
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Blain @ 2023-02-22 1:07 UTC (permalink / raw)
To: Kernel.org Tools; +Cc: Konstantin Ryabitsev, Philippe Blain
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>
---
b4/ez.py | 9 ++++++---
1 file 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')
---
base-commit: ada3021c64dd484e53219eb3af55da6c8f25d0ec
change-id: 20230221-fix-base-commit-for-non-commit-strategies-a0d6ef465d86
--
b4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH b4] ez: get_series_details: correctly compute 'base_commit' for all strategies
2023-02-22 1:07 [PATCH b4] ez: get_series_details: correctly compute 'base_commit' for all strategies Philippe Blain
@ 2023-03-03 20:00 ` Konstantin Ryabitsev
0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2023-03-03 20:00 UTC (permalink / raw)
To: Kernel.org Tools, Philippe Blain
On Tue, 21 Feb 2023 20:07:46 -0500, Philippe Blain wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] ez: get_series_details: correctly compute 'base_commit' for all strategies
commit: 221cc6ccd40d3e643bc65b34f2fca72ad2a69363
Best regards,
--
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-03 20:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 1:07 [PATCH b4] ez: get_series_details: correctly compute 'base_commit' for all strategies Philippe Blain
2023-03-03 20:00 ` Konstantin Ryabitsev
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).