From b81e00a965c62ca72a4b9db425ee173de147808d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 30 Nov 2009 16:23:50 -0800 Subject: [PATCH] git-merge: a deprecation notice of the ancient command line syntax The ancient form of git merge command used in the original sample script has been copied from Linus and are still found everywhere, I think, and people may still have it in their scripts, but on the other hand, it is so unintuitive that even people reasonably familiar with git are surprised by accidentally triggering the support to parse this ancient form. Gently nudge people to upgrade their script to more recent and readable style for eventual removal of the original syntax. Signed-off-by: Junio C Hamano --- builtin-merge.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin-merge.c b/builtin-merge.c index b6b84286b..6bf841e78 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -789,6 +789,11 @@ static int suggest_conflicts(void) return 1; } +static const char deprecation_warning[] = + "'git merge HEAD ' is deprecated. Please update\n" + "your script to use 'git merge -m ' instead.\n" + "In future versions of git, this syntax will be removed."; + static struct commit *is_old_style_invocation(int argc, const char **argv) { struct commit *second_token = NULL; @@ -802,6 +807,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv) die("'%s' is not a commit", argv[1]); if (hashcmp(second_token->object.sha1, head)) return NULL; + warning(deprecation_warning); } return second_token; } -- 2.30.2