diff options
| author | Siddharth Asthana <siddharthasthana31@gmail.com> | 2026-03-26 01:53:51 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-25 14:20:57 -0700 |
| commit | 1e6434ebbd63d4ec0ad2f8bccf25bd0d98d55030 (patch) | |
| tree | 23067f37847c2fc9b8f5e01688c891ce16929061 /contrib/completion/git-completion.bash | |
| parent | 864f55e1906897b630333675a52874c0fec2a45c (diff) | |
| download | git-1e6434ebbd63d4ec0ad2f8bccf25bd0d98d55030.tar.xz | |
sequencer: extract revert message formatting into shared function
The logic for formatting revert commit messages (handling "Revert" and
"Reapply" cases, appending "This reverts commit <ref>.", and handling
merge-parent references) currently lives inline in do_pick_commit().
The upcoming replay --revert mode needs to reuse this logic.
Extract all of this into a new sequencer_format_revert_message()
function. The function takes a repository, the subject line, commit,
parent, a use_commit_reference flag, and the output strbuf. It handles
both regular reverts ("Revert "<subject>"") and revert-of-revert cases
("Reapply "<subject>""), and uses refer_to_commit() internally to
format the commit reference.
Update refer_to_commit() to take a struct repository parameter instead
of relying on the_repository, and a bool instead of reading from
replay_opts directly. This makes it usable from the new shared function
without pulling in sequencer-specific state.
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
0 files changed, 0 insertions, 0 deletions
