From 42939f1a244451ed3b9dcb2d2e3eea2bcb08f6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 15 Jun 2012 16:33:15 +0200 Subject: Documentation: --no-walk is no-op if range is specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing description can be misleading and cause the reader to think that --no-walk will do something if they specify a range in the command line instead of a set of revs. Signed-off-by: Carlos Martín Nieto Signed-off-by: Junio C Hamano diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 6a4b635..5b44029 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -622,6 +622,7 @@ These options are mostly targeted for packing of git repositories. --no-walk:: Only show the given revs, but do not traverse their ancestors. + This has no effect if a range is specified. --do-walk:: -- cgit v0.10.2-6-g49f6 From b98878edefd284927748aa2ce9ff090fa43c2c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 15 Jun 2012 16:33:16 +0200 Subject: git-cherry-pick.txt: clarify the use of revision range notation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 lead the user to think that git cherry-pick A B..C may apply A and then B..C, but that is not what happens. Instead the revs are given to a single invocation of rev-list, which will consider A and C as positive revs and B as a negative one. The commit A will not be used if it is an ancestor of B. 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 Signed-off-by: Junio C Hamano diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index fed5097..49ac61c 100644 --- a/Documentation/git-cherry-pick.txt +++ b/Documentation/git-cherry-pick.txt @@ -47,7 +47,9 @@ OPTIONS linkgit:gitrevisions[7]. 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]. + linkgit:git-rev-list[1]. Note that specifying a range will + feed all ... arguments to a single revision walk + (see a later example that uses 'maint master..next'). -e:: --edit:: @@ -130,6 +132,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 maint next ^master`:: +`git cherry-pick maint master..next`:: + + Apply the changes introduced by all commits that are + ancestors of maint or next, but not master or any of its + ancestors. Note that the latter does not mean `maint` and + everything between `master` and `next`; specifically, + `maint` will not be used if it is included in `master`. + `git cherry-pick master{tilde}4 master{tilde}2`:: Apply the changes introduced by the fifth and third last -- cgit v0.10.2-6-g49f6