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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/27/21 6:48 PM, Felipe Contreras wrote:
Alex Henrie wrote:
On Tue, Jul 27, 2021 at 2:45 AM Junio C Hamano <gitster@xxxxxxxxx> wrote:

Alex Henrie <alexhenrie24@xxxxxxxxx> 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@xxxxxxxxxx
web: https://www.aixigo.com
District Court Aachen – HRB 8057
Board: Christian Friedrich, Tobias Haustein
Chairman of the Supervisory Board: Dr. Roland Schlager



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux