{"thread":{"id":"14485","subject":"[PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description","startedAt":"2008-07-16T12:35:22Z","lastAt":"2008-07-16T15:49:43Z","messageCount":2,"participants":["Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83511","messageId":"20080716123344.5875.88693.stgit@localhost","threadId":"14485","inReplyTo":null,"subject":"[PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-16T12:35:22Z","receivedAt":"2008-07-16T12:35:22Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"The manual page of git-cherry-pick and git-revert asserts that -n works\nprimarily on the working tree, while in fact the primary object it operates\non is the index, and the changes only \"accidentally\" propagate to the\nworking tree. This e.g. leads innocent #git IRC folks to believe that you\ncan use -n to prepare changes for git-add -i staging.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n  I'm actually not *entirely* sure about the exact working tree vs. index\nsemantics of the -n parameter, this is a guess based on the code.\nUnfortunately, I'm currently too busy with other things to check\nthoroughly, and I'm sure other people on the list will know off-hand.\n\n Documentation/git-cherry-pick.txt |   10 +++++-----\n Documentation/git-revert.txt      |   16 ++++++++--------\n 2 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex a691173..50fb3d5 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -58,14 +58,14 @@ OPTIONS\n \tUsually the command automatically creates a commit with\n \ta commit log message stating which commit was\n \tcherry-picked.  This flag applies the change necessary\n-\tto cherry-pick the named commit to your working tree,\n-\tbut does not make the commit.  In addition, when this\n-\toption is used, your working tree does not have to match\n+\tto cherry-pick the named commit to your working tree\n+\tand the index, but does not make the commit.  In addition,\n+\twhen this option is used, your index does not have to match\n \tthe HEAD commit.  The cherry-pick is done against the\n-\tbeginning state of your working tree.\n+\tbeginning state of your index.\n +\n This is useful when cherry-picking more than one commits'\n-effect to your working tree in a row.\n+effect to your index in a row.\n \n -s::\n --signoff::\ndiff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt\nindex 5411edc..271850f 100644\n--- a/Documentation/git-revert.txt\n+++ b/Documentation/git-revert.txt\n@@ -43,16 +43,16 @@ OPTIONS\n -n::\n --no-commit::\n \tUsually the command automatically creates a commit with\n-\ta commit log message stating which commit was reverted.\n-\tThis flag applies the change necessary to revert the\n-\tnamed commit to your working tree, but does not make the\n-\tcommit.  In addition, when this option is used, your\n-\tworking tree does not have to match the HEAD commit.\n-\tThe revert is done against the beginning state of your\n-\tworking tree.\n+\ta commit log message stating which commit was\n+\treverted.  This flag applies the change necessary\n+\tto revert the named commit to your working tree\n+\tand the index, but does not make the commit.  In addition,\n+\twhen this option is used, your index does not have to match\n+\tthe HEAD commit.  The revert is done against the\n+\tbeginning state of your index.\n +\n This is useful when reverting more than one commits'\n-effect to your working tree in a row.\n+effect to your index in a row.\n \n -s::\n --signoff::\n"},{"id":"83529","messageId":"7vmykhu8vc.fsf@gitster.siamese.dyndns.org","threadId":"14485","inReplyTo":"20080716123344.5875.88693.stgit@localhost","subject":"Re: [PATCH] Documentation/git-cherry-pick.txt et al.: Fix misleading -n description","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T15:49:43Z","receivedAt":"2008-07-16T15:49:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> The manual page of git-cherry-pick and git-revert asserts that -n works\n> primarily on the working tree, while in fact the primary object it operates\n> on is the index, and the changes only \"accidentally\" propagate to the\n> working tree. This e.g. leads innocent #git IRC folks to believe that you\n> can use -n to prepare changes for git-add -i staging.\n\nTrue, and false ;-)  Just \"unstage\" first in your \"git add -i\" session and\nthen add only the necessary pieces back to the index (alternatively you\ncan \"reset\" before entering \"git add -i\" session).\n\nThe change is good; will apply.\n"}]}