Skip to content

Commit 36a83f3

Browse files
committed
Merge branch 'jc/deprecate-old-syntax-from-merge'
* jc/deprecate-old-syntax-from-merge: git-merge: a deprecation notice of the ancient command line syntax
2 parents 4a27759 + b81e00a commit 36a83f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

builtin-merge.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,11 @@ static int suggest_conflicts(void)
796796
return 1;
797797
}
798798

799+
static const char deprecation_warning[] =
800+
"'git merge <msg> HEAD <commit>' is deprecated. Please update\n"
801+
"your script to use 'git merge -m <msg> <commit>' instead.\n"
802+
"In future versions of git, this syntax will be removed.";
803+
799804
static struct commit *is_old_style_invocation(int argc, const char **argv)
800805
{
801806
struct commit *second_token = NULL;
@@ -809,6 +814,7 @@ static struct commit *is_old_style_invocation(int argc, const char **argv)
809814
die("'%s' is not a commit", argv[1]);
810815
if (hashcmp(second_token->object.sha1, head))
811816
return NULL;
817+
warning(deprecation_warning);
812818
}
813819
return second_token;
814820
}

0 commit comments

Comments
 (0)