git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] merge: deprecate 'git merge <message> HEAD <commit>' syntax

From
Jeff King <peff@peff.net>
Date
Mar 26, 2015, 13:20 UTC
Message-ID
<20150326132014.GA16427@peff.net>
In-Reply-To
<xmqqvbhoz75m.fsf@gitster.dls.corp.google.com>
On Wed, Mar 25, 2015 at 09:58:45PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> We had this in "git merge" manual for eternity:
> 
>     'git merge' <msg> HEAD <commit>...
> 
>     [This] syntax (<msg> `HEAD` <commit>...) is supported for
>     historical reasons.  Do not use it from the command line or in
>     new scripts.  It is the same as `git merge -m <msg> <commit>...`.

It would be nice to see this ancient wart ago. I agree we need a deprecation period, though, as you've outlined here.

Show 7 quoted lines
>  builtin/merge.c               | 1 +
>  git-cvsimport.perl            | 2 +-
>  git-pull.sh                   | 2 +-
>  t/t3402-rebase-merge.sh       | 2 +-
>  t/t6021-merge-criss-cross.sh  | 6 +++---
>  t/t9402-git-cvsserver-refs.sh | 2 +-
>  6 files changed, 8 insertions(+), 7 deletions(-)
Maybe squash in:
diff --git a/t/t6020-merge-df.sh b/t/t6020-merge-df.sh
index 27c3d73..2af1bee 100755
--- a/t/t6020-merge-df.sh
+++ b/t/t6020-merge-df.sh
@@ -24,7 +24,7 @@ test_expect_success 'prepare repository' '
 '
 
 test_expect_success 'Merge with d/f conflicts' '
-	test_expect_code 1 git merge "merge msg" B master
+	test_expect_code 1 git merge -m "merge msg" master
 '
 
 test_expect_success 'F/D conflict' '


We do not call it HEAD here, but the setup test just before has put us
on branch B, so I think it is equivalent.

-Peff
Previous: Junio C HamanoNext: Eric Sunshine
Message 3 of 4 in “merge: deprecate 'git merge <message> HEAD <commit>' syntax”
  1. merge: deprecate 'git merge <message> HEAD <commit>' syntaxJunio C Hamano, Mar 26, 2015
  2. merge: drop 'git merge <message> HEAD <commit>' syntaxJunio C Hamano, Mar 26, 2015
  3. Jeff KingMar 26, 2015
  4. Eric SunshineMar 26, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.