All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Elijah Newren <newren@gmail.com>
Cc: Sergey Organov <sorganov@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	"C.J. Jameson" <cjcjameson@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC PATCH] cherry-pick: set default `--mainline` parent to 1
Date: Fri, 22 Mar 2019 11:13:13 +0100 (STD)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1903221106001.41@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <CABPp-BEe56GFM_2g7EyXmSrULFwRAvSPBomQ66jEQmCs=HhWpg@mail.gmail.com>

Hi Elijah,

On Wed, 20 Mar 2019, Elijah Newren wrote:

> On Wed, Mar 20, 2019 at 8:09 AM Sergey Organov <sorganov@gmail.com> wrote:
> >
> > Junio C Hamano <gitster@pobox.com> writes:
> >
> > [...]
> >
> > > But I do have a very strong opinion against adding yet another
> > > option that takes an optional argument.  If we want to allow
> > > cherry-picking a merge commit just as easy as cherrry-picking a
> > > single-parent commit, "git cherry-pick -m merge" (assuming 'merge'
> > > is the tip of a branch that is a merge commit) that still requires
> > > the user to say "-m" is not a good improvement.  We should just
> > > accept "git cherry-pick merge" without any "-m" if we want to move
> > > in this direction, I would think.
> >
> > Let's just make '-m 1' the default option indeed. No need for further
> > complexities.
> >
> > Exactly according to what Junio has already said before. Here:
> >
> > https://public-inbox.org/git/xmqqsh5gt9sm.fsf@gitster-ct.c.googlers.com
> >
> > Junio wrote:
> >
> > > Now, it appears, at least to me, that the world pretty much accepted
> > > that the first-parent worldview is often very convenient and worth
> > > supporting by the tool, so the next logical step might be to set
> > > opts->mainline to 1 by default (and allow an explicit "-m $n" from
> > > the command line to override it).  But that should happen after this
> > > patch lands---it is logically a separate step, I would think.
> >
> > ... and as that patch already landed...
>
> This worries me that it'll lead to bad surprises.

Indeed. Merge commits simply do not have the same semantics as regular
commits. They not only have more than one parent, they also have the
further complication that they, unlike regular commits, do not introduce
regular code changes, but need to reconcile diverging code changes
instead.

As such, cherry-picking a merge commit typically leads to *many, many*
more merge conflicts than cherry-picking regular commits.

It would appear to be a wise idea to keep that safety line in place, where
users cherry-picking the wrong commit would have to tell Git that they
really are sure that they want to cherry-pick a merge commit.

And I know that I've been there myself, so it is not just some users you
might dismiss as less than smart (which is actually not a smart thing to
do, users are the essential audience of our software, and if we make it
hard for users, it is not the users who failed).

We cannot just "ignore away" that merge commits are different from regular
commits: Neither in the data shape nor in their purpose are they the same.

Ciao,
Dscho

  parent reply	other threads:[~2019-03-22 10:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20  3:54 [RFC PATCH] cherry-pick: set default `--mainline` parent to 1 C.J. Jameson
2019-03-20  4:45 ` Junio C Hamano
2019-03-20 12:01   ` Sergey Organov
2019-03-20 14:39     ` Elijah Newren
2019-03-20 15:59       ` Sergey Organov
2019-03-21  1:51         ` C.J. Jameson
2019-03-21  2:17       ` Junio C Hamano
2019-03-21  3:15         ` Junio C Hamano
2019-03-21  5:40           ` Sergey Organov
2019-03-21  5:47             ` Junio C Hamano
2019-03-21  6:12               ` Sergey Organov
2019-03-21  8:31                 ` Junio C Hamano
2019-03-21  8:31                 ` Junio C Hamano
2019-03-21 11:59                   ` Sergey Organov
2019-03-22  2:24                     ` Junio C Hamano
2019-03-22 15:22                       ` Sergey Organov
2019-03-22 18:27                         ` C.J. Jameson
2019-03-25 14:55                           ` Johannes Schindelin
2019-03-25 15:41                             ` C.J. Jameson
2019-03-21  6:54               ` Sergey Organov
2019-03-22 10:23         ` Johannes Schindelin
2019-03-22 10:13       ` Johannes Schindelin [this message]
2019-03-20  9:44 ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.1903221106001.41@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=cjcjameson@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=sorganov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.