Skip to content

Commit

Permalink
merge: force edit and no-ff mode when merging a tag object
Browse files Browse the repository at this point in the history
Now that we allow pulling a tag from the remote site to validate the
authenticity, we should give the user the final chance to verify and edit
the merge message. The integrator is expected to leave a meaningful merge
commit log in the history. Disallow fast-forwarding in such a case to
ensure that a merge commit is always recorded.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Nov 9, 2011
1 parent 5231c63 commit fab47d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
sha1_to_hex(commit->object.sha1));
setenv(buf.buf, argv[i], 1);
strbuf_reset(&buf);
if (merge_remote_util(commit) &&
merge_remote_util(commit)->obj &&
merge_remote_util(commit)->obj->type == OBJ_TAG) {
option_edit = 1;
allow_fast_forward = 0;
}
}

if (!use_strategies) {
Expand Down

0 comments on commit fab47d0

Please sign in to comment.