diff options
author | Josh Triplett <josh@joshtriplett.org> | 2013-10-27 01:34:02 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-10-30 11:32:10 -0700 |
commit | 517fcac36fdc59cd9fa1e67212cd9b49d5fda475 (patch) | |
tree | 4cc4e48b586c489ab3910a4e4e2bd4ae7a565a38 /sequencer.h | |
parent | 0d6cf2471f426dd2b742e2285aad78381738be96 (diff) | |
download | git-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 'sequencer.h')
-rw-r--r-- | sequencer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h index 1fc22dcabe..8716ad0228 100644 --- a/sequencer.h +++ b/sequencer.h @@ -7,6 +7,7 @@ #define SEQ_OPTS_FILE "sequencer/opts" #define APPEND_SIGNOFF_DEDUP (1u << 0) +#define APPEND_EXTRA_ONLY (1u << 1) enum replay_action { REPLAY_REVERT, @@ -51,5 +52,7 @@ int sequencer_pick_revisions(struct replay_opts *opts); extern const char sign_off_header[]; void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag); +void append_signoff_extra(struct strbuf *msgbuf, int ignore_footer, + unsigned flag, struct strbuf *extrabuf); #endif |