git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Eugen Konkov <kes-kes@yandex.ru>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Cherry-pick picks more commits (and miss some) than provided
Date: Wed, 29 Jul 2020 11:09:29 -0700	[thread overview]
Message-ID: <CABPp-BF4C1ixfYn=Bavg+kbnB0M=KJv=yuh_nxymwX-woGhh5A@mail.gmail.com> (raw)
In-Reply-To: <186376813.20200729195318@yandex.ru>

On Wed, Jul 29, 2020 at 10:00 AM Eugen Konkov <kes-kes@yandex.ru> wrote:
>
> Hello Git,
>
> $ git --version
> git version 2.28.0
>
>
> If I do
> git cherry-pick 90a075bf f2c161b7^..ae27237e fb7e608e f34c9562 76f2568a fb141148
>
> then more commits are copied and some commits are ignored

This says to pick all the commits in the history of 90a075bf or
ae27237e or fb7e608e or f34c9562 or 76f2568a or fb141148 that are not
in the history of f2c161b7^.  In other words, it'll cherry-pick all
the commits that show up in the output of either
  git rev-list 90a075bf f2c161b7^..ae27237e fb7e608e f34c9562 76f2568a fb141148
or, equivalently, the output of
  git rev-list 90a075bf ae27237e fb7e608e f34c9562 76f2568a fb141148
--not f2c161b7^

> But when I do step by step then every thing is OK
>
> git cherry-pick 90a075bf
> git cherry-pick f2c161b7^..ae27237e
> git cherry-pick fb7e608e f34c9562 76f2568a fb141148

This is very different.  This says to pick all the commits in the
history of ae27237e that are not in the history of f2c161b7^, plus
grab commits 90a075bf, fb7e608e, f34c9562, 76f2568a, and fb141148.

The only cases when the two would mean the same thing are when all of
90a075bf, fb7e608e, f34c9562, 76f2568a, and fb141148 have f2c161b7^ as
their parent.

This comes from this part of the manual:
       <commit>...
           Commits to cherry-pick. For a more complete list of ways to
spell commits, see gitrevisions(7). Sets of
           commits can be passed but no traversal is done by default,
as if the --no-walk option was specified, see
           git-rev-list(1). Note that specifying a range will feed all
<commit>... arguments to a single revision
           walk (see a later example that uses maint master..next).

The fact that you specified a range (f2c161b7^..ae27237e) among your
arguments, meant that the implicit --no-walk was omitted and now all
arguments became ranges.

      reply	other threads:[~2020-07-29 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-29 16:53 Cherry-pick picks more commits (and miss some) than provided Eugen Konkov
2020-07-29 18:09 ` Elijah Newren [this message]

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='CABPp-BF4C1ixfYn=Bavg+kbnB0M=KJv=yuh_nxymwX-woGhh5A@mail.gmail.com' \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kes-kes@yandex.ru \
    /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).