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

Re: [PATCH v2] pull: introduce --merge option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 28, 2021, 19:25 UTC
Message-ID
<6101af37cabc_41362084d@natae.notmuch>
In-Reply-To
<xmqqv94u9x2l.fsf@gitster.g>
Junio C Hamano wrote:
Show 31 quoted lines
> Matthias Baumgarten <matthias.baumgarten@aixigo.com> writes:
> 
> > Add to Felipes list:
> >
> >  * git switch -m
> >
> > and maybe git cherry-pick -m where -m does not mean "merge" itself but
> > is used to determine the parent of the merge (when picking merge 
> > commits) to base on.
> >
> > Other examples of where -m has different meaning than merge:
> >
> >  * git am -m (message-id)
> >  * git branch -m (move branch)
> >
> > I would rephrase the question as to what would I expect `git pull -m`
> > to do, if I had never heard of it before. In the case of
> > fast-forwarding and rebasing trying to add a merge commit message with
> > -m would not even make sense. Only in the case of trying to create a
> > merge commit by issuing git pull this would make sense. So if we could
> > agree on that being not the most used scenario, I think -m would be a
> > great short option for --merge.
> 
> I am afraid that you are misinterpreting what I said, comparing
> apples and oranges, and drawing a wrong conclusion.
> 
> When I said "-m" would not fly well as a short-hand for "--merge" in
> the context of "pull", I didn't mean "nobody would think 'm' stands
> for 'merge'", and I didn't mean "more people would think 'm' stands
> for 'message' more than 'merge'".  The reason why I find it
> problematic is because it can be ambiguous.

The question shouldn't be "can it be ambiguous?", the question should be "is it ambiguous?".

The *main* purpose of `git pull` is to integrate remote changes, and the first question asked is "how?".

  git pull --merge|-m
  git pull --rebase|-r
So I don't see why it is ambiguous.

The fact that a tiny minority of users might find a command (any command) ambiguous is not valid reason for its inexistence. By that rationale `git pull` shouldn't exist at all, because many find it ambiguous that it's not the symmetric command opposed to `git push`.

The vast majority of users shouldn't suffer because of the confusion of a tiny few. The tiny few can simply look at the documentation.

-- 
Felipe Contreras
Previous: Matthias BaumgartenNext: Felipe Contreras
Message 12 of 13 in “pull: introduce --merge option”
  1. pull: introduce --merge optionFelipe Contreras, Jul 21, 2021
  2. Linus TorvaldsJul 21, 2021
  3. Junio C HamanoJul 21, 2021
  4. Alex HenrieJul 26, 2021
  5. Felipe ContrerasJul 27, 2021
  6. Junio C HamanoJul 27, 2021
  7. Alex HenrieJul 27, 2021
  8. Felipe ContrerasJul 27, 2021
  9. Matthias BaumgartenJul 28, 2021
  10. Junio C HamanoJul 28, 2021
  11. Matthias BaumgartenJul 28, 2021
  12. Felipe ContrerasJul 28, 2021
  13. Felipe ContrerasJul 27, 2021

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.