]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: comment `--reference` subject line properly
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Mon, 25 Nov 2024 20:13:12 +0000 (21:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Nov 2024 01:05:08 +0000 (10:05 +0900)
commit515d034f8d922602b9d417cdc02768757aa6f6c1
tree986cc6b410098f0735cf33e172692b5a3118911b
parent94304b9f48e9c68f3214e25527c3aac865d3ce63
sequencer: comment `--reference` subject line properly

`git revert --reference <commit>` leaves behind a comment in the
first line:[1]

    # *** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***

Meaning that the commit will just consist of the next line if the user
exits the editor directly:

    This reverts commit <--format=reference commit>

But the comment char here is hardcoded (#).  Which means that the
comment line will inadvertently be included in the commit message if
`core.commentChar`/`core.commentString` is in use.

† 1: See 43966ab3156 (revert: optionally refer to commit in the
    "reference" format, 2022-05-26)

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3501-revert-cherry-pick.sh