[PATCH] git-merge: a deprecation notice of the ancient command line syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 is 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 <gitster@xxxxxxxxx>
---

    And this is the first step of such a deprecation.  Perhaps we start
    warning in 1.7.0 and remove it in 1.8.0, or something like that.

 builtin-merge.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/builtin-merge.c b/builtin-merge.c
index e5cf795..4cb695e 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 <msg> HEAD <commit>' is deprecated. Please update\n"
+	"your script to use 'git merge -m <msg> <commit>' 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 +806,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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]