git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches
@ 2019-04-11  1:12 ron
  2019-04-12  7:05 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: ron @ 2019-04-11  1:12 UTC (permalink / raw)
  To: git

First time reporting a bug :) or at least what I think it may be.

There's a few similar cases I think I've seen in the past, but the one I'm sure about is the semicolon instead of space between multiple branches, that should be a syntax error if git merge can't accept that command .. if the people I spoke with are correct; However, git merge reports it as "not something we can merge" implying that it suppose to be valid syntax and that it's just not allowed function or that it may be temporairly not possible due to a circumstance (a secondary condition), as if I was mistyping the name of the branch or something, but if it never accepts anything with a semicolon it ought to be a syntax error, IMO.
And it may not be uncommon since it comes from the fact that git merge normally follows git fetch where semicolon is supported as per normal.

Ron

Sent with ProtonMail Secure Email.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches
  2019-04-11  1:12 Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches ron
@ 2019-04-12  7:05 ` Junio C Hamano
  2019-04-12 13:37   ` Ron
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2019-04-12  7:05 UTC (permalink / raw)
  To: ron; +Cc: git\

ron <ronazek@protonmail.com> writes:

> ... And it may not be uncommon since it comes from the fact that
> git merge normally follows git fetch where semicolon is supported
> as per normal.

I do not know what "git fetch" uses semicolon for here.  Care to
elaborate?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches
  2019-04-12  7:05 ` Junio C Hamano
@ 2019-04-12 13:37   ` Ron
  2019-04-12 15:21     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ron @ 2019-04-12 13:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git\\

> Junio C Hamano <gitster@pobox.com> wrote:

> I do not know what "git fetch" uses semicolon for here. Care to
> elaborate?

Those were all typos, I meant colon, two dots. Sorry.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches
  2019-04-12 13:37   ` Ron
@ 2019-04-12 15:21     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2019-04-12 15:21 UTC (permalink / raw)
  To: Ron; +Cc: git\

Ron <ronazek@protonmail.com> writes:

>> I do not know what "git fetch" uses semicolon for here. Care to
>> elaborate?
>
> Those were all typos, I meant colon, two dots. Sorry.

Do you mean to say that because you can say

	$ git fetch origin +master:refs/remotes/origin/master

you expected that you can say this?

	$ git merge +master:refs/remotes/origin/master

The "git merge" command takes one or more commit-ishes to be merged
to the current branch on its command line, and the above command
line is correct at the syntax level.

But because 'master:refs/remotes/origin/master' does not name a
commit-ish, it is the right thing to barf, saying that it is not
something the command can merge.

If you replace the colon with space, that would mean an entirely
different thing, i.e.

	$ git merge master refs/remotes/origin/master

would mean "I want two commit-ishes, the tip of my 'master' branch,
and the last observed commit at the tip of the 'master' branch at
the 'origin' repository, merged into the branch that is currently
checked out, making an octopus merge".  It also is syntactically
correct, but it may not be what you wanted to do.  Most likely, you
would have rather wanted to do one of these:

	$ git merge refs/remotes/origin/master
	$ git merge origin/master
	$ git merge origin

In any case, because the "what to fetch, followed by where to store
it, separated by a colon, with how to store it optionally signalled
by a leading plus sign" argument syntax used by "git fetch" must
convey a lot more (and different kind of) information than "which
commit to merge to the currently checked-out branch" argument syntax
used by "git merge", these two commands have to take quite different
kind of information and use quite different ways to express these
two kinds of information at the syntax level.  The 'master' on the
left-hand-side of the colon used by "git fetch" does not even name
the 'master' branch _you_ have, while "git merge" that is a totally
local operation only can name a commit-ish object that is locally
available (e.g. a request to merge the 'master' branch you have
would say "git merge master").

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-11  1:12 Git merge should report an actual syntax error when a semicolon is used instead of space for specifying multiple branches ron
2019-04-12  7:05 ` Junio C Hamano
2019-04-12 13:37   ` Ron
2019-04-12 15:21     ` Junio C Hamano

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox