Skip to content

Commit a913b56

Browse files
committed
Merge branch 'cn/cherry-pick-range-docs'
The command line argument of "git cherry-pick maint master..next" is just an ordinary revision range, which is unintuitive and at least deserves documentation. * cn/cherry-pick-range-docs: git-cherry-pick.txt: clarify the use of revision range notation Documentation: --no-walk is no-op if range is specified
2 parents 6a7f2b2 + b98878e commit a913b56

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Documentation/git-cherry-pick.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ OPTIONS
4747
linkgit:gitrevisions[7].
4848
Sets of commits can be passed but no traversal is done by
4949
default, as if the '--no-walk' option was specified, see
50-
linkgit:git-rev-list[1].
50+
linkgit:git-rev-list[1]. Note that specifying a range will
51+
feed all <commit>... arguments to a single revision walk
52+
(see a later example that uses 'maint master..next').
5153

5254
-e::
5355
--edit::
@@ -149,6 +151,15 @@ EXAMPLES
149151
Apply the changes introduced by all commits that are ancestors
150152
of master but not of HEAD to produce new commits.
151153

154+
`git cherry-pick maint next ^master`::
155+
`git cherry-pick maint master..next`::
156+
157+
Apply the changes introduced by all commits that are
158+
ancestors of maint or next, but not master or any of its
159+
ancestors. Note that the latter does not mean `maint` and
160+
everything between `master` and `next`; specifically,
161+
`maint` will not be used if it is included in `master`.
162+
152163
`git cherry-pick master~4 master~2`::
153164

154165
Apply the changes introduced by the fifth and third last

Documentation/rev-list-options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ These options are mostly targeted for packing of git repositories.
622622
--no-walk::
623623

624624
Only show the given revs, but do not traverse their ancestors.
625+
This has no effect if a range is specified.
625626

626627
--do-walk::
627628

0 commit comments

Comments
 (0)