{"thread":{"id":"33202","subject":"[PATCH] rev-parse: Clarify documentation of @{upstream} syntax","startedAt":"2013-03-16T18:51:43Z","lastAt":"2013-03-17T22:17:09Z","messageCount":3,"participants":["Kacper Kornet","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"211469","messageId":"1363459903-32358-1-git-send-email-draenog@pld-linux.org","threadId":"33202","inReplyTo":null,"subject":"[PATCH] rev-parse: Clarify documentation of @{upstream} syntax","fromName":"Kacper Kornet","fromEmail":"draenog@pld-linux.org","sentAt":"2013-03-16T18:51:43Z","receivedAt":"2013-03-16T18:51:43Z","isPatch":true,"sender":{"key":"draenog@pld-linux.org","avatar":"https://avatars.githubusercontent.com/u/608762?v=4"},"body":"git-rev-parse interprets string in string@{upstream} as a name of\na branch not a ref. For example refs/heads/master@{upstream} looks\nfor an upstream branch that is merged by git-pull to ref\nrefs/heads/refs/heads/master not to refs/heads/master. However the\ndocumentation could misled a user to believe that the string is\ninterpreted as ref.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n Documentation/revisions.txt | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex 678d175..314e25d 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -88,10 +88,10 @@ some output processing may assume ref names in UTF-8.\n   The construct '@\\{-<n>\\}' means the <n>th branch checked out\n   before the current one.\n \n-'<refname>@\\{upstream\\}', e.g. 'master@\\{upstream\\}', '@\\{u\\}'::\n-  The suffix '@\\{upstream\\}' to a ref (short form '<refname>@\\{u\\}') refers to\n-  the branch the ref is set to build on top of.  A missing ref defaults\n-  to the current branch.\n+'<branchname>@\\{upstream\\}', e.g. 'master@\\{upstream\\}', '@\\{u\\}'::\n+  The suffix '@\\{upstream\\}' to a branchname (short form '<branchname>@\\{u\\}')\n+  refers to the branch that the branch specified by branchname is set to build on\n+  top of.  A missing branchname defaults to the current one.\n \n '<rev>{caret}', e.g. 'HEAD{caret}, v1.5.1{caret}0'::\n   A suffix '{caret}' to a revision parameter means the first parent of\n-- \n1.8.2\n"},{"id":"211480","messageId":"CAPig+cTL_u_AV1-E9JhBRP2JP97vod9iWpRtM0SETX9-GL_-2w@mail.gmail.com","threadId":"33202","inReplyTo":"1363459903-32358-1-git-send-email-draenog@pld-linux.org","subject":"Re: [PATCH] rev-parse: Clarify documentation of @{upstream} syntax","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-03-17T04:31:18Z","receivedAt":"2013-03-17T04:31:18Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Mar 16, 2013 at 2:51 PM, Kacper Kornet <draenog@pld-linux.org> wrote:\n> git-rev-parse interprets string in string@{upstream} as a name of\n> a branch not a ref. For example refs/heads/master@{upstream} looks\n> for an upstream branch that is merged by git-pull to ref\n> refs/heads/refs/heads/master not to refs/heads/master. However the\n> documentation could misled a user to believe that the string is\n\ns/misled/mislead/\n\n> interpreted as ref.\n"},{"id":"211534","messageId":"20130317221708.GA7707@camk.edu.pl","threadId":"33202","inReplyTo":"1363459903-32358-1-git-send-email-draenog@pld-linux.org","subject":"[PATCH] t1507: Test that branchname@{upstream} is interpreted as branch","fromName":"Kacper Kornet","fromEmail":"draenog@pld-linux.org","sentAt":"2013-03-17T22:17:09Z","receivedAt":"2013-03-17T22:17:09Z","isPatch":true,"sender":{"key":"draenog@pld-linux.org","avatar":"https://avatars.githubusercontent.com/u/608762?v=4"},"body":"Syntax branchname@{upstream} should interpret its argument as a name of\na branch. Add the test to check that it doesn't try to interpret it as a\nrefname if the branch in question does not exist.\n\nSigned-off-by: Kacper Kornet <draenog@pld-linux.org>\n---\n\nMaybe I'm too cautious adding this test. But just in case here it is.\n\n t/t1507-rev-parse-upstream.sh | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh\nindex d6e5761..b27a720 100755\n--- a/t/t1507-rev-parse-upstream.sh\n+++ b/t/t1507-rev-parse-upstream.sh\n@@ -54,6 +54,10 @@ test_expect_success 'my-side@{upstream} resolves to correct full name' '\n \ttest refs/remotes/origin/side = \"$(full_name my-side@{u})\"\n '\n \n+test_expect_success 'refs/heads/my-side@{upstream} does not resolve to my-side{upstream}' '\n+\ttest_must_fail full_name refs/heads/my-side@{upstream}\n+'\n+\n test_expect_success 'my-side@{u} resolves to correct commit' '\n \tgit checkout side &&\n \ttest_commit 5 &&\n-- \n1.8.2\n"}]}