mirror of
https://github.com/git/git.git
synced 2026-04-10 00:40:14 +02:00
Merge branch 'bc/append-signed-off-by'
Consolidate codepaths that inspect log-message-to-be and decide to add a new Signed-off-by line in various commands. * bc/append-signed-off-by: git-commit: populate the edit buffer with 2 blank lines before s-o-b Unify appending signoff in format-patch, commit and sequencer format-patch: update append_signoff prototype t4014: more tests about appending s-o-b lines sequencer.c: teach append_signoff to avoid adding a duplicate newline sequencer.c: teach append_signoff how to detect duplicate s-o-b sequencer.c: always separate "(cherry picked from" from commit body sequencer.c: require a conforming footer to be preceded by a blank line sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer t/t3511: add some tests of 'cherry-pick -s' functionality t/test-lib-functions.sh: allow to specify the tag name to test_commit commit, cherry-pick -s: remove broken support for multiline rfc2822 fields sequencer.c: rework search for start of footer to improve clarity
This commit is contained in:
@@ -702,7 +702,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
|
||||
previous = eol;
|
||||
}
|
||||
|
||||
append_signoff(&sb, ignore_footer);
|
||||
append_signoff(&sb, ignore_footer, 0);
|
||||
}
|
||||
|
||||
if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len)
|
||||
|
||||
@@ -1086,7 +1086,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
struct commit *origin = NULL, *head = NULL;
|
||||
const char *in_reply_to = NULL;
|
||||
struct patch_ids ids;
|
||||
char *add_signoff = NULL;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
int use_patch_format = 0;
|
||||
int quiet = 0;
|
||||
@@ -1193,16 +1192,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
rev.subject_prefix = strbuf_detach(&sprefix, NULL);
|
||||
}
|
||||
|
||||
if (do_signoff) {
|
||||
const char *committer;
|
||||
const char *endpos;
|
||||
committer = git_committer_info(IDENT_STRICT);
|
||||
endpos = strchr(committer, '>');
|
||||
if (!endpos)
|
||||
die(_("bogus committer info %s"), committer);
|
||||
add_signoff = xmemdupz(committer, endpos - committer + 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < extra_hdr.nr; i++) {
|
||||
strbuf_addstr(&buf, extra_hdr.items[i].string);
|
||||
strbuf_addch(&buf, '\n');
|
||||
@@ -1393,7 +1382,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
total++;
|
||||
start_number--;
|
||||
}
|
||||
rev.add_signoff = add_signoff;
|
||||
rev.add_signoff = do_signoff;
|
||||
while (0 <= --nr) {
|
||||
int shown;
|
||||
commit = list[nr];
|
||||
|
||||
Reference in New Issue
Block a user