summaryrefslogtreecommitdiff
path: root/Documentation/git-commit.txt
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2013-10-27 01:34:02 +0000
committerJunio C Hamano <gitster@pobox.com>2013-10-30 11:32:10 -0700
commit517fcac36fdc59cd9fa1e67212cd9b49d5fda475 (patch)
tree4cc4e48b586c489ab3910a4e4e2bd4ae7a565a38 /Documentation/git-commit.txt
parent0d6cf2471f426dd2b742e2285aad78381738be96 (diff)
downloadgit-jt/commit-fixes-footer.tar.gz
commit: Add -f, --fixes <commit> option to add Fixes: linejt/commit-fixes-footer
Linux Kernel Summit 2013 decided on a commit message convention to identify commits containing bugs fixed by a commit: a "Fixes:" line, included in the standard commit footer (along with "Signed-off-by:" if present), containing an abbreviated commit hash (at least 12 characters to keep it valid for a long time) and the subject of the commit (for human readers). This helps people (or automated tools) determine how far to backport a commit. Add a command line option for git commit to automatically construct the "Fixes:" line for a commit. This avoids the need to manually construct that line by copy-pasting the commit hash and subject. Also works with --amend to modify an existing commit's message. To add a Fixes line to an earlier commit in a series, use rebase -i and add the following line after the existing commit: x git commit --amend --no-edit --fixes $commit_containing_bug Generalize append_signoff to support appending arbitrary extra lines to a commit in the signoff block; this avoids duplicating the logic to find or construct that block. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-commit.txt')
-rw-r--r--Documentation/git-commit.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 1a7616c73a..350cf6075d 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -8,8 +8,8 @@ git-commit - Record changes to the repository
SYNOPSIS
--------
[verse]
-'git commit' [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
- [--dry-run] [(-c | -C | --fixup | --squash) <commit>]
+'git commit' [-a | --interactive | --patch] [-s] [--fixes <commit>] [-v] [-u<mode>]
+ [--amend] [--dry-run] [(-c | -C | --fixup | --squash) <commit>]
[-F <file> | -m <msg>] [--reset-author] [--allow-empty]
[--allow-empty-message] [--no-verify] [-e] [--author=<author>]
[--date=<date>] [--cleanup=<mode>] [--[no-]status]
@@ -156,6 +156,13 @@ OPTIONS
Add Signed-off-by line by the committer at the end of the commit
log message.
+--fixes=<commit>::
+ Add Fixes line for the specified commit at the end of the commit
+ log message. This line includes an abbreviated commit hash for
+ the specified commit; the `core.abbrev` option determines the
+ length of the abbreviated commit hash used, with a minimum length
+ of 12 hex digits.
+
-n::
--no-verify::
This option bypasses the pre-commit and commit-msg hooks.