From: "Carlos Martín Nieto" <cmn@elego.de>
To: git@vger.kernel.org
Cc: Yann Dirson <dirson@bertin.fr>
Subject: [PATCH 2/2] git-cherry-pick.txt: make clearer when revision walking gets activated
Date: Fri, 15 Jun 2012 16:33:16 +0200 [thread overview]
Message-ID: <1339770796-542-2-git-send-email-cmn@elego.de> (raw)
In-Reply-To: <1339770796-542-1-git-send-email-cmn@elego.de>
When given a set of commits, cherry-pick will apply the changes for
all of them. Specifying a simple range will also work as
expected. This can cause the user to think that
git cherry-pick A B..C
will apply A and then B..C. This is not what happens. Instead the revs
are given to rev-list which will consider A and C as positive revs and
B as a negative one. Add a note about this and add an example with
this particular syntax, which has shown up on the list a few times.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
Documentation/git-cherry-pick.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 06a0bfd..10abfbf 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -48,6 +48,7 @@ OPTIONS
Sets of commits can be passed but no traversal is done by
default, as if the '--no-walk' option was specified, see
linkgit:git-rev-list[1].
+ Note that specifying a range will activate revision walking.
-e::
--edit::
@@ -130,6 +131,15 @@ EXAMPLES
Apply the changes introduced by all commits that are ancestors
of master but not of HEAD to produce new commits.
+`git cherry-pick master next ^maint`::
+`git cherry-pick master maint..next`::
+
+ Apply the changes introduced by all commits that are ancestors
+ of master or next, but not maint or any of its ancestors. The
+ second spelling is often a misunderstanding of revision
+ walking works when trying to apply a range plus a particular
+ commit and included for completeness.
+
`git cherry-pick master~4 master~2`::
Apply the changes introduced by the fifth and third last
--
1.7.10.2.520.g6a4a482
next prev parent reply other threads:[~2012-06-15 14:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 9:44 [BUG] cherry-pick ignores some arguments Yann Dirson
2012-06-14 16:29 ` Carlos Martín Nieto
2012-06-15 7:14 ` Yann Dirson
2012-06-15 13:12 ` Carlos Martín Nieto
2012-06-15 14:33 ` [PATCH 1/2] Documentation: --no-walk is no-op if range is specified Carlos Martín Nieto
2012-06-15 14:33 ` Carlos Martín Nieto [this message]
2012-06-15 17:52 ` [PATCH 2/2] git-cherry-pick.txt: make clearer when revision walking gets activated Junio C Hamano
2012-06-15 17:37 ` [PATCH 1/2] Documentation: --no-walk is no-op if range is specified Junio C Hamano
2012-06-15 14:39 ` [BUG] cherry-pick ignores some arguments Carlos Martín Nieto
2012-06-15 15:06 ` Junio C Hamano
2012-06-15 15:03 ` Junio C Hamano
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=1339770796-542-2-git-send-email-cmn@elego.de \
--to=cmn@elego.de \
--cc=dirson@bertin.fr \
--cc=git@vger.kernel.org \
/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 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 NNTP newsgroup(s).