summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-27 06:01:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-27 06:05:03 (GMT)
commit43966ab3156a082067bf9930351e96e9488da735 (patch)
tree540a2bf2af1738c6084a68b58ad4018bbbab2386 /sequencer.h
parent6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e (diff)
downloadgit-43966ab3156a082067bf9930351e96e9488da735.zip
git-43966ab3156a082067bf9930351e96e9488da735.tar.gz
git-43966ab3156a082067bf9930351e96e9488da735.tar.bz2
revert: optionally refer to commit in the "reference" format
A typical "git revert" commit uses the full title of the original commit in its title, and starts its body of the message with: This reverts commit 8fa7f667cf61386257c00d6e954855cc3215ae91. This does not encourage the best practice of describing not just "what" (i.e. "Revert X" on the title says what we did) but "why" (i.e. and it does not say why X was undesirable). We can instead phrase this first line of the body to be more like This reverts commit 8fa7f667 (do this and that, 2022-04-25) so that the title does not have to be Revert "do this and that" We can instead use the title to describe "why" we are reverting the original commit. Introduce the "--reference" option to "git revert", and also the revert.reference configuration variable, which defaults to false, to tweak the title and the first line of the draft commit message for when creating a "revert" commit. When this option is in use, the first line of the pre-filled editor buffer becomes a comment line that tells the user to say _why_. If the user exits the editor without touching this line by mistake, what we prepare to become the first line of the body, i.e. "This reverts commit 8fa7f667 (do this and that, 2022-04-25)", ends up to be the title of the resulting commit. This behaviour is designed to help such a user to identify such a revert in "git log --oneline" easily so that it can be further reworded with "git rebase -i" later. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r--sequencer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h
index da64473..698599f 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -49,6 +49,7 @@ struct replay_opts {
int reschedule_failed_exec;
int committer_date_is_author_date;
int ignore_date;
+ int commit_use_reference;
int mainline;