{"thread":{"id":"25089","subject":"[PATCH 5/6] git-reset.txt: point to git-checkout","startedAt":"2010-09-13T08:06:30Z","lastAt":"2010-09-15T20:47:44Z","messageCount":22,"participants":["Michael J Gruber","Jay Soffian","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"150581","messageId":"cover.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":null,"subject":"[PATCH 0/6] git-reset.txt improvements","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:30Z","receivedAt":"2010-09-13T08:06:30Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"First of all: I've been out of the loop last week, so please forgive me if this\ncomes at the wrong phase of a cycle.\n\nI portioned the changes to git-reset.txt and ordered them starting from the\nleast controversial, I hope. The descriptions of modes have grown organically\nover time, and this series tries to make them consistent in structure and\nwording, after cleaning up some minor issues. 6/6 is the \"meat\", so to say.\n\nFor the \"--merge\" description in 6/6: Please double check. I've tried to\nunderstand the mode from the tables and from the inner works (git read-tre -u -m\nplus carrying over unmerged entries) because I did not understand the original\ndescription.\n\n\nMichael J Gruber (6):\n  git-reset.txt: clarify branch vs. branch head\n  git-reset.txt: reset does not change files in target\n  git-reset.txt: reset --soft is not a no-op\n  git-reset.txt: use \"working tree\" consistently\n  git-reset.txt: point to git-checkout\n  git-reset.txt: make modes description more consistent\n\n Documentation/git-reset.txt |   63 ++++++++++++++++++++++++++-----------------\n 1 files changed, 38 insertions(+), 25 deletions(-)\n\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150579","messageId":"4cb6432e6fc534231841ca8301b9022fa038946c.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 1/6] git-reset.txt: clarify branch vs. branch head","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:31Z","receivedAt":"2010-09-13T08:06:31Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"\"Change the branch\" can be misunderstood to mean \"change which branch is\nchecked out\". Make it clearer that git-reset changes the branch head of\nthe currently checked out branch.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 9cf3148..7d68b4c 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -15,7 +15,7 @@ SYNOPSIS\n DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n-In the third form, set the current branch to <commit>, optionally\n+In the third form, set the current branch head to <commit>, optionally\n modifying index and worktree to match.  The <commit> defaults to HEAD\n in all forms.\n \n@@ -36,7 +36,7 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n linkgit:git-add[1]).\n \n 'git reset' [--<mode>] [<commit>]::\n-\tThis form points the current branch to <commit> and then\n+\tThis form sets the current branch head to <commit> and then\n \tupdates index and working tree according to <mode>, which must\n \tbe one of the following:\n +\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150582","messageId":"9669b7872536d2555d4b2c01560c552d97fdd81b.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 2/6] git-reset.txt: reset does not change files in target","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:32Z","receivedAt":"2010-09-13T08:06:32Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git-reset obviously cannot change files in an existing commit. Make it\nnot sound as if it could: reset can change HEAD and, in that sense, can\nchange which state a file in HEAD is in.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 7d68b4c..8fb871c 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -295,7 +295,7 @@ file. For example, the first line of the first table means that if a\n file is in state A in the working tree, in state B in the index, in\n state C in HEAD and in state D in the target, then \"git reset --soft\n target\" will put the file in state A in the working tree, in state B\n-in the index and in state D in HEAD.\n+in the index and set HEAD to target (which has the file in state D).\n \n       working index HEAD target         working index HEAD\n       ----------------------------------------------------\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150577","messageId":"f30121dda2c44d2a87f2d2bf651d6a0adfa8c955.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 3/6] git-reset.txt: reset --soft is not a no-op","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:33Z","receivedAt":"2010-09-13T08:06:33Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Make it clearer that git reset --soft actually does something (changing\nHEAD). While it is meantioned in the previous paragraph already it can\nbe easily overlooked otherwise.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 8fb871c..65f5d07 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -43,7 +43,8 @@ linkgit:git-add[1]).\n --\n --soft::\n \tDoes not touch the index file nor the working tree at all, but\n-\trequires them to be in a good order. This leaves all your changed\n+\trequires them to be in good order (and sets the head to <commit>,\n+\tjust like all modes do). This leaves all your changed\n \tfiles \"Changes to be committed\", as 'git status' would\n \tput it.\n \n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150580","messageId":"30bf6d6227a2ebbe4453bd77d44c726cc56d078b.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 4/6] git-reset.txt: use \"working tree\" consistently","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:34Z","receivedAt":"2010-09-13T08:06:34Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"as per git help glossary\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 65f5d07..60b4b80 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -16,12 +16,12 @@ DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n In the third form, set the current branch head to <commit>, optionally\n-modifying index and worktree to match.  The <commit> defaults to HEAD\n+modifying index and working tree to match.  The <commit> defaults to HEAD\n in all forms.\n \n 'git reset' [-q] [<commit>] [--] <paths>...::\n \tThis form resets the index entries for all <paths> to their\n-\tstate at the <commit>.  (It does not affect the worktree, nor\n+\tstate at the <commit>.  (It does not affect the working tree, nor\n \tthe current branch.)\n +\n This means that `git reset <paths>` is the opposite of `git add\n@@ -185,7 +185,7 @@ tip of the current branch in ORIG_HEAD, so resetting hard to it\n brings your index file and the working tree back to that state,\n and resets the tip of the branch to that commit.\n \n-Undo a merge or pull inside a dirty work tree::\n+Undo a merge or pull inside a dirty working tree::\n +\n ------------\n $ git pull                         <1>\n@@ -258,7 +258,7 @@ Suppose you are working on something and you commit it, and then you\n continue working a bit more, but now you think that what you have in\n your working tree should be in another branch that has nothing to do\n with what you committed previously. You can start a new branch and\n-reset it while keeping the changes in your work tree.\n+reset it while keeping the changes in your working tree.\n +\n ------------\n $ git tag start\n@@ -347,11 +347,11 @@ in the index and set HEAD to target (which has the file in state D).\n \t\t\t\t--keep   B       C     C\n \n \"reset --merge\" is meant to be used when resetting out of a conflicted\n-merge. Any mergy operation guarantees that the work tree file that is\n+merge. Any mergy operation guarantees that the working tree file that is\n involved in the merge does not have local change wrt the index before\n-it starts, and that it writes the result out to the work tree. So if\n+it starts, and that it writes the result out to the working tree. So if\n we see some difference between the index and the target and also\n-between the index and the work tree, then it means that we are not\n+between the index and the working tree, then it means that we are not\n resetting out from a state that a mergy operation left after failing\n with a conflict. That is why we disallow --merge option in this case.\n \n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150576","messageId":"520620a60966ebdfa6e1fe8b407b0de51c302b82.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 5/6] git-reset.txt: point to git-checkout","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:35Z","receivedAt":"2010-09-13T08:06:35Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"for the case of updating a file in index and worktree.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 60b4b80..40e2fd8 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -27,6 +27,9 @@ in all forms.\n This means that `git reset <paths>` is the opposite of `git add\n <paths>`.\n \n+If you want to reset index entry and working tree state of a file,\n+linkgit:git-checkout[1] is your friend.\n+\n 'git reset' --patch|-p [<commit>] [--] [<paths>...]::\n \tInteractively select hunks in the difference between the index\n \tand <commit> (defaults to HEAD).  The chosen hunks are applied\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150578","messageId":"d4a048c1cfd39a2d7ab8a86554bb48937629620c.1284365021.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCH 6/6] git-reset.txt: make modes description more consistent","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-13T08:06:36Z","receivedAt":"2010-09-13T08:06:36Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Currently, the structure of the individual mode entries is different\nwhich makes it difficult to grasp the differences between the modes.\nAlso, the same items are named differently (e.g. <commit>, \"the named\ncommit\", \"the given commit\", \"the commit being switched to\").\n\nStructure and word all mode entries consistently.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |   43 ++++++++++++++++++++++++++-----------------\n 1 files changed, 26 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 40e2fd8..6b60b59 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -15,13 +15,13 @@ SYNOPSIS\n DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n-In the third form, set the current branch head to <commit>, optionally\n+In the third form, set the current branch head (HEAD) to <commit>, optionally\n modifying index and working tree to match.  The <commit> defaults to HEAD\n in all forms.\n \n 'git reset' [-q] [<commit>] [--] <paths>...::\n \tThis form resets the index entries for all <paths> to their\n-\tstate at the <commit>.  (It does not affect the working tree, nor\n+\tstate at <commit>.  (It does not affect the working tree, nor\n \tthe current branch.)\n +\n This means that `git reset <paths>` is the opposite of `git add\n@@ -39,9 +39,10 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n linkgit:git-add[1]).\n \n 'git reset' [--<mode>] [<commit>]::\n-\tThis form sets the current branch head to <commit> and then\n-\tupdates index and working tree according to <mode>, which must\n-\tbe one of the following:\n+\tThis form sets the current branch head to <commit> and\n+\tpossibly updates the index (resetting it to the tree of <commit>) and\n+\tthe working tree depending on <mode>, which\n+\tmust be one of the following:\n +\n --\n --soft::\n@@ -57,22 +58,30 @@ linkgit:git-add[1]).\n \tbeen updated. This is the default action.\n \n --hard::\n-\tMatches the working tree and index to that of the tree being\n-\tswitched to. Any changes to tracked files in the working tree\n-\tsince <commit> are lost.\n+\tResets the index and working tree. Any changes to tracked files in the\n+\tworking tree since <commit> are lost.\n \n --merge::\n-\tResets the index to match the tree recorded by the named commit,\n-\tand updates the files that are different between the named commit\n-\tand the current commit in the working tree.\n+\tResets the index and updates the files in the working tree that are\n+\tdifferent between <commit> and HEAD, but keeps those which are\n+\tdifferent between the index and working tree (i.e. which have unstaged\n+\tchanges).\n+\tIf a file that is different between <commit> and the index has unstaged\n+\tchanges, reset is aborted.\n++\n+In other words, --merge does something like a 'git read-tree -u -m <commit>',\n+but carries forward unmerged index entries.\n \n --keep::\n-\tReset the index to the given commit, keeping local changes in\n-\tthe working tree since the current commit, while updating\n-\tworking tree files without local changes to what appears in\n-\tthe given commit.  If a file that is different between the\n-\tcurrent commit and the given commit has local changes, reset\n-\tis aborted.\n+\tResets the index, updates files in the working tree that are\n+\tdifferent between <commit> and HEAD, but keeps those\n+\twhich are different between HEAD and the working tree (i.e.\n+\twhich have local changes).\n+\tIf a file that is different between <commit> and HEAD has local changes,\n+\treset is aborted.\n++\n+In other words, --keep does a 2-way merge between <commit> and HEAD followed by\n+'git reset --mixed <commit>'.\n --\n \n If you want to undo a commit other than the latest on a branch,\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150648","messageId":"AANLkTin1Ht+2Q4v5pyt8p11VmQ275C41rJLMLLuLkEfA@mail.gmail.com","threadId":"25089","inReplyTo":"f30121dda2c44d2a87f2d2bf651d6a0adfa8c955.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 3/6] git-reset.txt: reset --soft is not a no-op","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-09-13T22:13:55Z","receivedAt":"2010-09-13T22:13:55Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Sep 13, 2010 at 4:06 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Make it clearer that git reset --soft actually does something (changing\n> HEAD). While it is meantioned in the previous paragraph already it can\n> be easily overlooked otherwise.\n>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n>  Documentation/git-reset.txt |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\n> index 8fb871c..65f5d07 100644\n> --- a/Documentation/git-reset.txt\n> +++ b/Documentation/git-reset.txt\n> @@ -43,7 +43,8 @@ linkgit:git-add[1]).\n>  --\n>  --soft::\n>        Does not touch the index file nor the working tree at all, but\n> -       requires them to be in a good order. This leaves all your changed\n> +       requires them to be in good order (and sets the head to <commit>,\n> +       just like all modes do). This leaves all your changed\n>        files \"Changes to be committed\", as 'git status' would\n>        put it.\n\nWhat does \"requires them to be in good order\" mean anyway?\n\nj.\n"},{"id":"150649","messageId":"AANLkTi=Th0BN=ojA8F-7d-__Fp=+bRvtCi37i5vfy8-o@mail.gmail.com","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 0/6] git-reset.txt improvements","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-09-13T22:15:50Z","receivedAt":"2010-09-13T22:15:50Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Sep 13, 2010 at 4:06 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> First of all: I've been out of the loop last week, so please forgive me if this\n> comes at the wrong phase of a cycle.\n>\n> I portioned the changes to git-reset.txt and ordered them starting from the\n> least controversial, I hope. The descriptions of modes have grown organically\n> over time, and this series tries to make them consistent in structure and\n> wording, after cleaning up some minor issues. 6/6 is the \"meat\", so to say.\n>\n> For the \"--merge\" description in 6/6: Please double check. I've tried to\n> understand the mode from the tables and from the inner works (git read-tre -u -m\n> plus carrying over unmerged entries) because I did not understand the original\n> description.\n\nMy quick read of these changes is that, all around, they are a big\nimprovement to what I find to be one of git's most confusing man\npages.\n\nj.\n"},{"id":"150652","messageId":"7v39tdb59e.fsf@alter.siamese.dyndns.org","threadId":"25089","inReplyTo":"AANLkTin1Ht+2Q4v5pyt8p11VmQ275C41rJLMLLuLkEfA@mail.gmail.com","subject":"Re: [PATCH 3/6] git-reset.txt: reset --soft is not a no-op","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-13T23:19:57Z","receivedAt":"2010-09-13T23:19:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Mon, Sep 13, 2010 at 4:06 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Make it clearer that git reset --soft actually does something (changing\n>> HEAD). While it is meantioned in the previous paragraph already it can\n>> be easily overlooked otherwise.\n>>\n>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n>> ---\n>>  Documentation/git-reset.txt |    3 ++-\n>>  1 files changed, 2 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\n>> index 8fb871c..65f5d07 100644\n>> --- a/Documentation/git-reset.txt\n>> +++ b/Documentation/git-reset.txt\n>> @@ -43,7 +43,8 @@ linkgit:git-add[1]).\n>>  --\n>>  --soft::\n>>        Does not touch the index file nor the working tree at all, but\n>> -       requires them to be in a good order. This leaves all your changed\n>> +       requires them to be in good order (and sets the head to <commit>,\n>> +       just like all modes do). This leaves all your changed\n>>        files \"Changes to be committed\", as 'git status' would\n>>        put it.\n>\n> What does \"requires them to be in good order\" mean anyway?\n\nGood point.  I don't think it means anything now; for that matter I do not\nthink it meant anything even back when that sentence was added in f67545e\n(Docs for git-reset-script., 2005-09-07).  A soft reset doesn't even look\nat the index nor the working tree, so there is no good nor bad order\nthere.\n\nJust remove it.\n"},{"id":"150654","messageId":"7vpqwh9oa7.fsf@alter.siamese.dyndns.org","threadId":"25089","inReplyTo":"9669b7872536d2555d4b2c01560c552d97fdd81b.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 2/6] git-reset.txt: reset does not change files in target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-14T00:12:00Z","receivedAt":"2010-09-14T00:12:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> git-reset obviously cannot change files in an existing commit. Make it\n> not sound as if it could: reset can change HEAD and, in that sense, can\n> change which state a file in HEAD is in.\n> ...\n> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\n> index 7d68b4c..8fb871c 100644\n> --- a/Documentation/git-reset.txt\n> +++ b/Documentation/git-reset.txt\n> @@ -295,7 +295,7 @@ file. For example, the first line of the first table means that if a\n>  file is in state A in the working tree, in state B in the index, in\n>  state C in HEAD and in state D in the target, then \"git reset --soft\n>  target\" will put the file in state A in the working tree, in state B\n> -in the index and in state D in HEAD.\n> +in the index and set HEAD to target (which has the file in state D).\n\nI would further suggest to make it clear that soft reset does not touch\neither the index nor the working tree, e.g.:\n\n    \"git reset --soft target\" will leave the file in the working tree in\n    state A and the index in state B.  It moves the HEAD (i.e. the tip of\n    the current branch, if you are on one) to \"target\" (which has the file\n    in state D).\n"},{"id":"150655","messageId":"7vlj759nyd.fsf@alter.siamese.dyndns.org","threadId":"25089","inReplyTo":"520620a60966ebdfa6e1fe8b407b0de51c302b82.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 5/6] git-reset.txt: point to git-checkout","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-14T00:19:06Z","receivedAt":"2010-09-14T00:19:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> for the case of updating a file in index and worktree.\n>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n>  Documentation/git-reset.txt |    3 +++\n>  1 files changed, 3 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\n> index 60b4b80..40e2fd8 100644\n> --- a/Documentation/git-reset.txt\n> +++ b/Documentation/git-reset.txt\n> @@ -27,6 +27,9 @@ in all forms.\n>  This means that `git reset <paths>` is the opposite of `git add\n>  <paths>`.\n>  \n> +If you want to reset index entry and working tree state of a file,\n> +linkgit:git-checkout[1] is your friend.\n> +\n\nI am not quite sure if this is an improvement.\n\nYou can reset the index entry using git-reset and then check the path out\nof the index to the working tree using git-checkout, in two separate\nsteps.  You can alternatively stuff the contents out of a commit (or more\nin general any tree-ish) to the index and check it out to the working tree\nwith a single git-checkout.  It is obvious to _me_ that you meant to hint\nthe latter in the above, but for people who need that hint it probably\nisn't.  Can we make it clearer?  Perhaps...\n\n    Using linkgit:git-checkout[1], you can copy the contents of a path out\n    of a commit to the index and to the working tree in one go.\n\nOr if you meant the former, \n\n    After running \"git reset <paths>\" to update the index entry, you can\n    use linkgit:git-checkout[1] to check the contents out of the index to\n    the working tree.\n"},{"id":"150656","messageId":"7vd3sh9n7l.fsf@alter.siamese.dyndns.org","threadId":"25089","inReplyTo":"d4a048c1cfd39a2d7ab8a86554bb48937629620c.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 6/6] git-reset.txt: make modes description more consistent","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-14T00:35:10Z","receivedAt":"2010-09-14T00:35:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\n> index 40e2fd8..6b60b59 100644\n> --- a/Documentation/git-reset.txt\n> +++ b/Documentation/git-reset.txt\n> @@ -15,13 +15,13 @@ SYNOPSIS\n>  DESCRIPTION\n>  -----------\n>  In the first and second form, copy entries from <commit> to the index.\n> -In the third form, set the current branch head to <commit>, optionally\n> +In the third form, set the current branch head (HEAD) to <commit>, optionally\n>  modifying index and working tree to match.  The <commit> defaults to HEAD\n>  in all forms.\n\nIn the documentation (not limited to \"git reset\"), we say \"update HEAD\"\nand expect the reader to understand that (1) when HEAD is not detached,\nthat updates what commit the current branch points at, (2) when HEAD is\ndetached, no branch is affected.\n\nBut that is asking too much to newcomers who weren't around before we\nintroduced detached HEAD around 1.5.0 timeframe.  This documentation\nglitch is there primarily because the detached HEAD came much later than\nall the \"updates the branch\" concepts were codified and documented for\nmany commands that advance/modify history, e.g. reset, commit, merge, etc.\n\nWe should rectify this, and I think this series is going in the right\ndirection.\n\n> @@ -39,9 +39,10 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n>  linkgit:git-add[1]).\n>  \n>  'git reset' [--<mode>] [<commit>]::\n> -\tThis form sets the current branch head to <commit> and then\n> -\tupdates index and working tree according to <mode>, which must\n> -\tbe one of the following:\n> +\tThis form sets the current branch head to <commit> and\n> +\tpossibly updates the index (resetting it to the tree of <commit>) and\n> +\tthe working tree depending on <mode>, which\n> +\tmust be one of the following:\n\nNice.\n\n> @@ -57,22 +58,30 @@ linkgit:git-add[1]).\n>  \tbeen updated. This is the default action.\n>  \n>  --hard::\n> -\tMatches the working tree and index to that of the tree being\n> -\tswitched to. Any changes to tracked files in the working tree\n> -\tsince <commit> are lost.\n> +\tResets the index and working tree. Any changes to tracked files in the\n> +\tworking tree since <commit> are lost.\n\nExplaining what \"reset\" does using the undefined word \"reset\" smells\nsomewhat wrong.  Not that \"matches\" is any better, but at least the\noriginal says \"to that of the tree\", which you seem to have lost, so there\nis no indication what they are reset _to_.  I don't think the above is a\ngood change for this reason.\n\nI also would prefer \"are discarded\" over \"are lost\".  It is a conscious\ndecision to use \"git reset --hard\" by the user in order to _do_ something,\nand \"discard\" is probably more accurate, in the sense that you use the\ncommand because you want to throw it away, than \"lose\" which implies you\nmight have wanted to keep but did something wrong.\n\n>  --merge::\n> -\tResets the index to match the tree recorded by the named commit,\n> -\tand updates the files that are different between the named commit\n> -\tand the current commit in the working tree.\n> +\tResets the index and updates the files in the working tree that are\n> +\tdifferent between <commit> and HEAD, but keeps those which are\n> +\tdifferent between the index and working tree (i.e. which have unstaged\n> +\tchanges).\n> +\tIf a file that is different between <commit> and the index has unstaged\n> +\tchanges, reset is aborted.\n\nIt may be just me, but \"unstaged\" sounds as if you once have staged and\nthen changed your mind and took it back.  \"... which have changes that\nhaven't been added\" might be clearer.\n\nAgain, it is made unclear what these entities are _reset to_ with the\nabove change.  Same comments apply for your change to --keep.\n"},{"id":"150657","messageId":"7v62y99n72.fsf@alter.siamese.dyndns.org","threadId":"25089","inReplyTo":"4cb6432e6fc534231841ca8301b9022fa038946c.1284365021.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 1/6] git-reset.txt: clarify branch vs. branch head","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-14T00:35:29Z","receivedAt":"2010-09-14T00:35:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> @@ -36,7 +36,7 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n>  linkgit:git-add[1]).\n>  \n>  'git reset' [--<mode>] [<commit>]::\n> -\tThis form points the current branch to <commit> and then\n> +\tThis form sets the current branch head to <commit> and then\n>  \tupdates index and working tree according to <mode>, which must\n>  \tbe one of the following:\n\nPerhaps \"resets\" or \"moves\" is even clearer?\n\nIn any case I think this is an improvement.\n"},{"id":"150748","messageId":"4C9130DF.70303@drmicha.warpmail.net","threadId":"25089","inReplyTo":"7vd3sh9n7l.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 6/6] git-reset.txt: make modes description more consistent","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:27Z","receivedAt":"2010-09-15T20:47:27Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Thanks for all your hints and thoughts. I'll be sending a v2 in a\nminute. There's just one point where I chose not to follow completely\nfor now:\n\nJunio C Hamano venit, vidit, dixit 14.09.2010 02:35:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n[snip]\n>> @@ -57,22 +58,30 @@ linkgit:git-add[1]).\n>>  \tbeen updated. This is the default action.\n>>  \n>>  --hard::\n>> -\tMatches the working tree and index to that of the tree being\n>> -\tswitched to. Any changes to tracked files in the working tree\n>> -\tsince <commit> are lost.\n>> +\tResets the index and working tree. Any changes to tracked files in the\n>> +\tworking tree since <commit> are lost.\n> \n> Explaining what \"reset\" does using the undefined word \"reset\" smells\n> somewhat wrong.  Not that \"matches\" is any better, but at least the\n> original says \"to that of the tree\", which you seem to have lost, so there\n> is no indication what they are reset _to_.  I don't think the above is a\n> good change for this reason.\n\nThe idea was to define \"reset\" once (in the paragraph right before the\nlist of modes) and then use it without repeating that. I tried to make\nthis a bit clearer now by emphasising the term \"reset\" more in the\nleading paragraph.\n\n[snip]\n> It may be just me, but \"unstaged\" sounds as if you once have staged and\n> then changed your mind and took it back.  \"... which have changes that\n> haven't been added\" might be clearer.\n\nWe use \"unstaged\" in the meaning of \"not staged/added yet\" in other\nplaces, as well - but in surprisingly few I have to admit! I went with\nyour version here.\n\nMichael\n"},{"id":"150749","messageId":"cover.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 0/6] git-reset.txt improvements","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:38Z","receivedAt":"2010-09-15T20:47:38Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"In v2 I tried to incorporate all changes as suggested by Junio. Thanks\nfor all the hints!\n\nMichael J Gruber (6):\n  git-reset.txt: clarify branch vs. branch head\n  git-reset.txt: reset does not change files in target\n  git-reset.txt: reset --soft is not a no-op\n  git-reset.txt: use \"working tree\" consistently\n  git-reset.txt: point to git-checkout\n  git-reset.txt: make modes description more consistent\n\n Documentation/git-reset.txt |   76 ++++++++++++++++++++++++++----------------\n 1 files changed, 47 insertions(+), 29 deletions(-)\n\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150752","messageId":"3ad8c4b01449e4d4563193bce9fd10365c59cccb.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 1/6] git-reset.txt: clarify branch vs. branch head","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:39Z","receivedAt":"2010-09-15T20:47:39Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"\"Change the branch\" can be misunderstood to mean \"change which branch is\nchecked out\". Make it clearer that git-reset changes the branch head of\nthe currently checked out branch.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 9cf3148..91bd2e9 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -15,7 +15,7 @@ SYNOPSIS\n DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n-In the third form, set the current branch to <commit>, optionally\n+In the third form, set the current branch head to <commit>, optionally\n modifying index and worktree to match.  The <commit> defaults to HEAD\n in all forms.\n \n@@ -36,7 +36,7 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n linkgit:git-add[1]).\n \n 'git reset' [--<mode>] [<commit>]::\n-\tThis form points the current branch to <commit> and then\n+\tThis form resets the current branch head to <commit> and then\n \tupdates index and working tree according to <mode>, which must\n \tbe one of the following:\n +\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150754","messageId":"248631a67b2f6bce911ccaeaf7b5762f57041e4f.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 2/6] git-reset.txt: reset does not change files in target","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:40Z","receivedAt":"2010-09-15T20:47:40Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git-reset obviously cannot change files in an existing commit. Make it\nnot sound as if it could: reset can change HEAD and, in that sense, can\nchange which state a file in HEAD is in.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 91bd2e9..e443740 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -294,8 +294,10 @@ In these tables, A, B, C and D are some different states of a\n file. For example, the first line of the first table means that if a\n file is in state A in the working tree, in state B in the index, in\n state C in HEAD and in state D in the target, then \"git reset --soft\n-target\" will put the file in state A in the working tree, in state B\n-in the index and in state D in HEAD.\n+target\" will leave the file in the working tree in state A and in the\n+index in state B.  It resets (i.e. moves) the HEAD (i.e. the tip of\n+the current branch, if you are on one) to \"target\" (which has the file\n+in state D).\n \n       working index HEAD target         working index HEAD\n       ----------------------------------------------------\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150755","messageId":"f78f891e34a6509e937e1235dffcdfb789ef9cc9.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 3/6] git-reset.txt: reset --soft is not a no-op","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:41Z","receivedAt":"2010-09-15T20:47:41Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Make it clearer that git reset --soft actually does something (changing\nHEAD). While it is mentioned in the previous paragraph already it can\nbe easily overlooked otherwise.\n\nAlso, git reset --soft does not look at the index nor the worktree, so\nthere is no \"good order\" requirement.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex e443740..8762a0c 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -42,10 +42,10 @@ linkgit:git-add[1]).\n +\n --\n --soft::\n-\tDoes not touch the index file nor the working tree at all, but\n-\trequires them to be in a good order. This leaves all your changed\n-\tfiles \"Changes to be committed\", as 'git status' would\n-\tput it.\n+\tDoes not touch the index file nor the working tree at all (but\n+\tresets the head to <commit>, just like all modes do). This leaves\n+\tall your changed files \"Changes to be committed\", as 'git status'\n+\twould put it.\n \n --mixed::\n \tResets the index but not the working tree (i.e., the changed files\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150751","messageId":"91fa950d676b7bace2264d262061ec774b16d5cc.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 4/6] git-reset.txt: use \"working tree\" consistently","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:42Z","receivedAt":"2010-09-15T20:47:42Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"as per git help glossary\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 8762a0c..6c94f83 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -16,12 +16,12 @@ DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n In the third form, set the current branch head to <commit>, optionally\n-modifying index and worktree to match.  The <commit> defaults to HEAD\n+modifying index and working tree to match.  The <commit> defaults to HEAD\n in all forms.\n \n 'git reset' [-q] [<commit>] [--] <paths>...::\n \tThis form resets the index entries for all <paths> to their\n-\tstate at the <commit>.  (It does not affect the worktree, nor\n+\tstate at the <commit>.  (It does not affect the working tree, nor\n \tthe current branch.)\n +\n This means that `git reset <paths>` is the opposite of `git add\n@@ -184,7 +184,7 @@ tip of the current branch in ORIG_HEAD, so resetting hard to it\n brings your index file and the working tree back to that state,\n and resets the tip of the branch to that commit.\n \n-Undo a merge or pull inside a dirty work tree::\n+Undo a merge or pull inside a dirty working tree::\n +\n ------------\n $ git pull                         <1>\n@@ -257,7 +257,7 @@ Suppose you are working on something and you commit it, and then you\n continue working a bit more, but now you think that what you have in\n your working tree should be in another branch that has nothing to do\n with what you committed previously. You can start a new branch and\n-reset it while keeping the changes in your work tree.\n+reset it while keeping the changes in your working tree.\n +\n ------------\n $ git tag start\n@@ -348,11 +348,11 @@ in state D).\n \t\t\t\t--keep   B       C     C\n \n \"reset --merge\" is meant to be used when resetting out of a conflicted\n-merge. Any mergy operation guarantees that the work tree file that is\n+merge. Any mergy operation guarantees that the working tree file that is\n involved in the merge does not have local change wrt the index before\n-it starts, and that it writes the result out to the work tree. So if\n+it starts, and that it writes the result out to the working tree. So if\n we see some difference between the index and the target and also\n-between the index and the work tree, then it means that we are not\n+between the index and the working tree, then it means that we are not\n resetting out from a state that a mergy operation left after failing\n with a conflict. That is why we disallow --merge option in this case.\n \n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150750","messageId":"4503439028b2670c7abd090115fc83d266794611.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 5/6] git-reset.txt: point to git-checkout","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:43Z","receivedAt":"2010-09-15T20:47:43Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"for the case of updating a file in index and worktree, or from the index\nto the worktree.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 6c94f83..78f3b74 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -26,6 +26,13 @@ in all forms.\n +\n This means that `git reset <paths>` is the opposite of `git add\n <paths>`.\n++\n+After running `git reset <paths>` to update the index entry, you can\n+use linkgit:git-checkout[1] to check the contents out of the index to\n+the working tree.\n+Alternatively, using linkgit:git-checkout[1] and specifying a commit, you\n+can copy the contents of a path out of a commit to the index and to the\n+working tree in one go.\n \n 'git reset' --patch|-p [<commit>] [--] [<paths>...]::\n \tInteractively select hunks in the difference between the index\n-- \n1.7.3.rc1.215.g6997c\n"},{"id":"150753","messageId":"f457ad06ac395e1db17e74ad3180ec42d7fafa45.1284582409.git.git@drmicha.warpmail.net","threadId":"25089","inReplyTo":"cover.1284365021.git.git@drmicha.warpmail.net","subject":"[PATCHv2 6/6] git-reset.txt: make modes description more consistent","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-15T20:47:44Z","receivedAt":"2010-09-15T20:47:44Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Currently, the structure of the individual mode entries is different\nwhich makes it difficult to grasp the differences between the modes.\nAlso, the same items are named differently (e.g. <commit>, \"the named\ncommit\", \"the given commit\", \"the commit being switched to\").\n\nStructure and word all mode entries consistently.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n\nConflicts:\n\n\tDocumentation/git-reset.txt\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-reset.txt |   43 ++++++++++++++++++++++++++-----------------\n 1 files changed, 26 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt\nindex 78f3b74..fd72976 100644\n--- a/Documentation/git-reset.txt\n+++ b/Documentation/git-reset.txt\n@@ -15,13 +15,13 @@ SYNOPSIS\n DESCRIPTION\n -----------\n In the first and second form, copy entries from <commit> to the index.\n-In the third form, set the current branch head to <commit>, optionally\n+In the third form, set the current branch head (HEAD) to <commit>, optionally\n modifying index and working tree to match.  The <commit> defaults to HEAD\n in all forms.\n \n 'git reset' [-q] [<commit>] [--] <paths>...::\n \tThis form resets the index entries for all <paths> to their\n-\tstate at the <commit>.  (It does not affect the working tree, nor\n+\tstate at <commit>.  (It does not affect the working tree, nor\n \tthe current branch.)\n +\n This means that `git reset <paths>` is the opposite of `git add\n@@ -43,9 +43,10 @@ This means that `git reset -p` is the opposite of `git add -p` (see\n linkgit:git-add[1]).\n \n 'git reset' [--<mode>] [<commit>]::\n-\tThis form resets the current branch head to <commit> and then\n-\tupdates index and working tree according to <mode>, which must\n-\tbe one of the following:\n+\tThis form resets the current branch head to <commit> and\n+\tpossibly updates the index (resetting it to the tree of <commit>) and\n+\tthe working tree depending on <mode>, which\n+\tmust be one of the following:\n +\n --\n --soft::\n@@ -60,22 +61,30 @@ linkgit:git-add[1]).\n \tbeen updated. This is the default action.\n \n --hard::\n-\tMatches the working tree and index to that of the tree being\n-\tswitched to. Any changes to tracked files in the working tree\n-\tsince <commit> are lost.\n+\tResets the index and working tree. Any changes to tracked files in the\n+\tworking tree since <commit> are discarded.\n \n --merge::\n-\tResets the index to match the tree recorded by the named commit,\n-\tand updates the files that are different between the named commit\n-\tand the current commit in the working tree.\n+\tResets the index and updates the files in the working tree that are\n+\tdifferent between <commit> and HEAD, but keeps those which are\n+\tdifferent between the index and working tree (i.e. which have changes\n+\twhich have not been added).\n+\tIf a file that is different between <commit> and the index has unstaged\n+\tchanges, reset is aborted.\n++\n+In other words, --merge does something like a 'git read-tree -u -m <commit>',\n+but carries forward unmerged index entries.\n \n --keep::\n-\tReset the index to the given commit, keeping local changes in\n-\tthe working tree since the current commit, while updating\n-\tworking tree files without local changes to what appears in\n-\tthe given commit.  If a file that is different between the\n-\tcurrent commit and the given commit has local changes, reset\n-\tis aborted.\n+\tResets the index, updates files in the working tree that are\n+\tdifferent between <commit> and HEAD, but keeps those\n+\twhich are different between HEAD and the working tree (i.e.\n+\twhich have local changes).\n+\tIf a file that is different between <commit> and HEAD has local changes,\n+\treset is aborted.\n++\n+In other words, --keep does a 2-way merge between <commit> and HEAD followed by\n+'git reset --mixed <commit>'.\n --\n \n If you want to undo a commit other than the latest on a branch,\n-- \n1.7.3.rc1.215.g6997c\n"}]}