git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "C.J. Jameson" <cjcjameson@gmail.com>
To: Sergey Organov <sorganov@gmail.com>
Cc: Elijah Newren <newren@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC PATCH] cherry-pick: set default `--mainline` parent to 1
Date: Wed, 20 Mar 2019 18:51:46 -0700	[thread overview]
Message-ID: <CALm+SVL1JkfaKt-B5oEHybBn40hy+b0zhBCtwv-ijN7EY14-yQ@mail.gmail.com> (raw)
In-Reply-To: <87lg19mt95.fsf@javad.com>

On Wed, Mar 20, 2019 at 8:59 AM Sergey Organov <sorganov@gmail.com> wrote:
>
> Elijah Newren <newren@gmail.com> writes:
>
> > 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.  Perhaps some folks
> > cherry-pick merges around intentionally, but I would want that to be a
> > rare occurrence at most.  There are lots of folks at $DAYJOB that
> > cherry-pick things, not all of them are expert git-users, and I am
> > certain several have erroneously attempted to cherry-pick merges
> > before.
>
> Wow, random Joes cherry-picking here and there... Sounds like a bigger
> problem is lurking here.

Indeed, I was the de facto release manager at $DAYJOB and I didn't know
about needing `--mainline` until we happened to need it. At this point,
it's just more fuel for me arguing that the merge commits are extraneous
noise in our repo's history, but projects have inertia-of-git-workflow.
>
> > I would much rather they continued to get an error message
> > and then asked other folks for help so that someone can explain to
> > them what they should instead be doing rather than silently changing
> > the current error into an unwanted operation.  Granted, the users will
> > at least get a confusing "Merge branch <foo>" commit message for
> > something that isn't a merge, but I don't think the users will notice
> > that either.  It just means we've got both confusing and ugly history
> > without the necessary individual commits or with too much having been
> > cherry-picked.
>
> To me it seems that cherry-picking wrong commit is cherry-picking wrong
> commit, no matter if it's a merge or not. I don't think that trying to
> save a user from such a mistake worth the trouble, given that
> cherry-pick is reversible operation, but I still see your point.
>
I'm with Sergey: that people would know what code is being brought in.

We could specifically code it up so that 3-way merges still need
an explicit `-m` to be set...

> > If -m 1 is too much to ask people to specify, could we provide some
> > other shorthand? Or at least make a default-off config option people
> > would have to set if they want a cherry-pick of a merge to succeed
> > without specifying -m?
>
> If we decide we still need this safety precaution, I'd opt to continue
> to require '-m 1' to cherry-pick a merge, rather than adding some
> special support. Not such a big deal.
>
> BTW, doesn't git have generic configuration support to add default
> option to a command, I wonder (I'm aware of aliases, but they don't
> seem to fit)? The C.J. then would simply add '-m 1' to 'cherry-pick' in
> configuration. No luck?
>
I'm not quite sure how I'd do that; pointers?

> -- Sergey
>

  reply	other threads:[~2019-03-21  1:52 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 [this message]
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
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CALm+SVL1JkfaKt-B5oEHybBn40hy+b0zhBCtwv-ijN7EY14-yQ@mail.gmail.com \
    --to=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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).