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

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

From
MBMatthias Baumgarten <matthias.baumgarten@aixigo.com>
Date
Jul 28, 2021, 07:44 UTC
Message-ID
<9e8f1c87-cd08-e1a2-fd5d-713cb0590049@aixigo.com>
In-Reply-To
<610038c0e1056_8fd52084a@natae.notmuch>
On 7/27/21 6:48 PM, Felipe Contreras wrote:
Show 30 quoted lines
> Alex Henrie wrote:
>> On Tue, Jul 27, 2021 at 2:45 AM Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>> Alex Henrie <alexhenrie24@gmail.com> writes:
>>>
>>>> Junio, would you be willing to accept adding -m without adding --merge also?
>>>
>>> My gut feeling is that "-m" without "--merge" in the context of
>>> "pull" is extremely unlikely to fly well.
>>>
>>> As "git pull" is a "git fetch" followed by a "git merge" (or "git
>>> rebase"), it takes the union of common command line options from
>>> both phases, and "git merge" takes "-m 'message'" which is an option
>>> fairly familiar to users (since it comes from "git commit").  Even
>>> if we are never going to pass "-m message" from "git pull" down to
>>> underlying "git merge", squatting on short and common "-m" would be
>>> a bad idea.
>>
>> Thanks for the explanation. I forgot that "-m" usually means
>> "message". That does seem like a good reason to not use "-m" for
>> "merge".
> 
> It means --merge plenty of times:
> 
>   * git restore -m
>   * git checkout -m
>   * git rebase -m
>   * git diff -m
>   * git read-tree -m
>   * git diff-tree -m
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.

-- 
aixigo AG
Karl-Friedrich-Str. 68, 52072 Aachen, Germany
phone: +49 (0)241 559709-390, fax: +49 (0)241 559709-99
email: matthias.baumgarten@aixigo.com
web: https://www.aixigo.com
District Court Aachen – HRB 8057
Board: Christian Friedrich, Tobias Haustein
Chairman of the Supervisory Board: Dr. Roland Schlager
Previous: Felipe ContrerasNext: Junio C Hamano
Message 9 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.