Re: [PATCH 19/17] merge: do not fast-forward when merging a tag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 9, 2011, 13:39 UTC
- Message-ID
- <7v39dxwh2j.fsf_-_@alter.siamese.dyndns.org>
- In-Reply-To
- <7v8vnpwhxl.fsf@alter.siamese.dyndns.org>
Merging a signed or an annotated tag is meant to trigger the editor for the integrator to leave a meaningful merge commit log in the history. Disallow fast-forwarding the merge in such a case to ensure that a merge commit is always recorded.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- builtin/merge.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/builtin/merge.c b/builtin/merge.c index 3b3e374..99f1429 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1255,8 +1255,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix) strbuf_reset(&buf); if (merge_remote_util(commit) && merge_remote_util(commit)->obj && - merge_remote_util(commit)->obj->type == OBJ_TAG) + merge_remote_util(commit)->obj->type == OBJ_TAG) { option_edit = 1; + allow_fast_forward = 0; + } } if (!use_strategies) {