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

Re: [PATCH] git-merge: mutually match SYNOPSIS and "usage".

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2014, 21:31 UTC
Message-ID
<xmqq1tqjefd8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<87bnpnsjrw.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
Show 6 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> ...
> I was looking at the merge.c code, and that's how it seems to work. You
> can get new semantics without -m, and you can't get old semantics with
> -m, isn't it? It looks like the set of descriptions I produced is
> formally correct.

The thing is, with "-m <msg>" we will never fall into the traditional syntax, hence "git merge -m <msg> <msg> HEAD <commit>" appear to be allowed with "git merge [options] <msg> HEAD <commit>...", but it is not.

And the inverse is not true (an obvious example is "git merge $branch", even though it does not have "-m <msg>" it uses the modern & common.

So the updated SYNOPSIS is not really helping.
Show 5 quoted lines
>> In other words, I agree with your motivation to call for attention
>> that the command behaves differently with and without "-m", but I do
>> not think that part of the change in this patch achieves it well.
>
> Any particular suggestion?

I was going to suggest "explain how the traditional syntax is triggered in the DESCRIPTION section", but it turns out that we already do that.

      The second 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>....

Strictly speaking, I think it is not qute "the same"---I recall vaguely that it broke tests if you replace the traditional-style invocation in 'git pull' with the -m <msg> syntax, but I do not have details handy; you may want to try it out if you are interested.

So I would think
	SYNOPSIS
        	git merge [options] <commit>...
		git merge [options] <msg> HEAD <commit>...
                git merge --abort

should be sufficient, possibly with some clarification on "The second syntax" paragraph in the DESCRIPTION section.

Previous: Sergey OrganovNext: Sergey Organov
Message 4 of 5 in “git-merge: mutually match SYNOPSIS and "usage".”
  1. git-merge: mutually match SYNOPSIS and "usage".Sergey Organov, Oct 7, 2014
  2. Junio C HamanoOct 7, 2014
  3. Sergey OrganovOct 7, 2014
  4. Junio C HamanoOct 7, 2014
  5. Sergey OrganovOct 8, 2014

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.