{"thread":{"id":"35640","subject":"Error in documentation for @{-n} in gitrevisions","startedAt":"2014-01-11T17:34:21Z","lastAt":"2014-01-19T07:01:15Z","messageCount":3,"participants":["Kevin","Ramkumar Ramachandra","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"233025","messageId":"CAO54GHBRbVQWDjE70tEZY=nP==gtrqVvmx1JWYNkc_HOeDnYDA@mail.gmail.com","threadId":"35640","inReplyTo":null,"subject":"Error in documentation for @{-n} in gitrevisions","fromName":"Kevin","fromEmail":"ikke@ikke.info","sentAt":"2014-01-11T17:34:21Z","receivedAt":"2014-01-11T17:34:21Z","isPatch":false,"sender":{"key":"ikke@ikke.info","avatar":"https://gravatar.com/avatar/60a0d08eeccb16914fdbfc7f3441548dc827dc436d5c6900ec6600e274e53c5b?d=mp&s=160"},"body":"While discussing the behavior of \"git checkout -\", I apparently was\nconfused because the documentation states:\n\n  The construct @{-<n>} means the <n>th branch checked out before the\ncurrent one.\n\nBut experimenting with it, it also takes you back to previously\ncheckout commits.\n\n  git-checkout-at-minus-one :: (master) » git checkout origin/master\n  Note: checking out 'origin/master'.\n  HEAD is now at f8b2f0c... two\n\n  git-checkout-at-minus-one :: (f8b2f0c) » git checkout -\n  Switched to branch 'master'\n\n  git-checkout-at-minus-one :: (master) » git checkout -\n                                              Note: checking out\n'f8b2f0c1419d1fe798159c2c2578d2dbe1323148'.\n  HEAD is now at f8b2f0c... two\n\nEither the documentation is wrong, and should be changed to \"<n>th\nbranch/commit checkout out before the current one\", or the behavior of\n@{-1} is wrong.\n"},{"id":"233029","messageId":"CALkWK0k51=Ek_r4eiX8kve=aoSwHxGjV9m_EbMnEadt6wALFwA@mail.gmail.com","threadId":"35640","inReplyTo":"CAO54GHBRbVQWDjE70tEZY=nP==gtrqVvmx1JWYNkc_HOeDnYDA@mail.gmail.com","subject":"Re: Error in documentation for @{-n} in gitrevisions","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2014-01-12T10:19:03Z","receivedAt":"2014-01-12T10:19:03Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Kevin wrote:\n> Either the documentation is wrong, and should be changed to \"<n>th\n> branch/commit checkout out before the current one\", or the behavior of\n> @{-1} is wrong.\n\nYeah, the documentation needs to be updated. Patches welcome.\n"},{"id":"233362","messageId":"c9a93954276440ae251dd763837d5159923b6d59.1390114656.git.tr@thomasrast.ch","threadId":"35640","inReplyTo":"CAO54GHBRbVQWDjE70tEZY=nP==gtrqVvmx1JWYNkc_HOeDnYDA@mail.gmail.com","subject":"[PATCH] Documentation: @{-N} can refer to a commit","fromName":"Thomas Rast","fromEmail":"tr@thomasrast.ch","sentAt":"2014-01-19T07:01:15Z","receivedAt":"2014-01-19T07:01:15Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The @{-N} syntax always referred to the N-th last thing checked out,\nwhich can be either a branch or a commit (for detached HEAD cases).\nHowever, the documentation only mentioned branches.\n\nEdit in a \"/commit\" in the appropriate places.\n\nReported-by: Kevin <ikke@ikke.info>\nSigned-off-by: Thomas Rast <tr@thomasrast.ch>\n---\n\nThis is the \"minimal\" edit.  I'd welcome better wording for the\ngit-commit manpage, I can't come up with any right now.\n\n\n Documentation/git-checkout.txt | 4 ++--\n Documentation/revisions.txt    | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt\nindex 91294f8..33ad2ad 100644\n--- a/Documentation/git-checkout.txt\n+++ b/Documentation/git-checkout.txt\n@@ -232,8 +232,8 @@ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.\n \tcommit, your HEAD becomes \"detached\" and you are no longer on\n \tany branch (see below for details).\n +\n-As a special case, the `\"@{-N}\"` syntax for the N-th last branch\n-checks out the branch (instead of detaching).  You may also specify\n+As a special case, the `\"@{-N}\"` syntax for the N-th last branch/commit\n+checks out branches (instead of detaching).  You may also specify\n `-` which is synonymous with `\"@{-1}\"`.\n +\n As a further special case, you may use `\"A...B\"` as a shortcut for the\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 2c06ed3..5a286d0 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -88,7 +88,7 @@ some output processing may assume ref names in UTF-8.\n   branch 'blabla' then '@\\{1\\}' means the same as 'blabla@\\{1\\}'.\n \n '@\\{-<n>\\}', e.g. '@\\{-1\\}'::\n-  The construct '@\\{-<n>\\}' means the <n>th branch checked out\n+  The construct '@\\{-<n>\\}' means the <n>th branch/commit checked out\n   before the current one.\n \n '<branchname>@\\{upstream\\}', e.g. 'master@\\{upstream\\}', '@\\{u\\}'::\n-- \n1.9.rc0.162.g8980120\n"}]}