* [PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description
@ 2008-07-16 12:35 Petr Baudis
2008-07-16 15:49 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Petr Baudis @ 2008-07-16 12:35 UTC (permalink / raw)
To: git; +Cc: gitster
The manual page of git-cherry-pick and git-revert asserts that -n works
primarily on the working tree, while in fact the primary object it operates
on is the index, and the changes only "accidentally" propagate to the
working tree. This e.g. leads innocent #git IRC folks to believe that you
can use -n to prepare changes for git-add -i staging.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
I'm actually not *entirely* sure about the exact working tree vs. index
semantics of the -n parameter, this is a guess based on the code.
Unfortunately, I'm currently too busy with other things to check
thoroughly, and I'm sure other people on the list will know off-hand.
Documentation/git-cherry-pick.txt | 10 +++++-----
Documentation/git-revert.txt | 16 ++++++++--------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index a691173..50fb3d5 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -58,14 +58,14 @@ OPTIONS
Usually the command automatically creates a commit with
a commit log message stating which commit was
cherry-picked. This flag applies the change necessary
- to cherry-pick the named commit to your working tree,
- but does not make the commit. In addition, when this
- option is used, your working tree does not have to match
+ to cherry-pick the named commit to your working tree
+ and the index, but does not make the commit. In addition,
+ when this option is used, your index does not have to match
the HEAD commit. The cherry-pick is done against the
- beginning state of your working tree.
+ beginning state of your index.
+
This is useful when cherry-picking more than one commits'
-effect to your working tree in a row.
+effect to your index in a row.
-s::
--signoff::
diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt
index 5411edc..271850f 100644
--- a/Documentation/git-revert.txt
+++ b/Documentation/git-revert.txt
@@ -43,16 +43,16 @@ OPTIONS
-n::
--no-commit::
Usually the command automatically creates a commit with
- a commit log message stating which commit was reverted.
- This flag applies the change necessary to revert the
- named commit to your working tree, but does not make the
- commit. In addition, when this option is used, your
- working tree does not have to match the HEAD commit.
- The revert is done against the beginning state of your
- working tree.
+ a commit log message stating which commit was
+ reverted. This flag applies the change necessary
+ to revert the named commit to your working tree
+ and the index, but does not make the commit. In addition,
+ when this option is used, your index does not have to match
+ the HEAD commit. The revert is done against the
+ beginning state of your index.
+
This is useful when reverting more than one commits'
-effect to your working tree in a row.
+effect to your index in a row.
-s::
--signoff::
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description
2008-07-16 12:35 [PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description Petr Baudis
@ 2008-07-16 15:49 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2008-07-16 15:49 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
Petr Baudis <pasky@suse.cz> writes:
> The manual page of git-cherry-pick and git-revert asserts that -n works
> primarily on the working tree, while in fact the primary object it operates
> on is the index, and the changes only "accidentally" propagate to the
> working tree. This e.g. leads innocent #git IRC folks to believe that you
> can use -n to prepare changes for git-add -i staging.
True, and false ;-) Just "unstage" first in your "git add -i" session and
then add only the necessary pieces back to the index (alternatively you
can "reset" before entering "git add -i" session).
The change is good; will apply.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-16 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 12:35 [PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description Petr Baudis
2008-07-16 15:49 ` Junio C Hamano
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).