{"thread":{"id":"17362","subject":"[PATCH 2/3] Documentation: more git push examples","startedAt":"2009-01-25T23:45:30Z","lastAt":"2009-01-26T06:24:06Z","messageCount":5,"participants":["Anders Melchiorsen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"101912","messageId":"1232927133-30377-1-git-send-email-mail@cup.kalibalik.dk","threadId":"17362","inReplyTo":null,"subject":"[PATCH 0/3] Documentation: refine refspec description","fromName":"Anders Melchiorsen","fromEmail":"mail@cup.kalibalik.dk","sentAt":"2009-01-25T23:45:30Z","receivedAt":"2009-01-25T23:45:30Z","isPatch":true,"sender":{"key":"mail@cup.kalibalik.dk","avatar":null},"body":"These are the remaining parts of my git-push refspec updates.\n\nI recall having a hard time making sense of the existing\ndocumentation, due to a lot of small questions that popped up.\nWith these patches, I try to reword things to make them clearer.\n\nIt is, however, getting to the point where I have looked at this so\nmuch that I can no longer tell whether I am actually improving things.\nThus, this will be my last submission for this particular itch.\n\n\nCheers,\nAnders.\n"},{"id":"101914","messageId":"1232927133-30377-2-git-send-email-mail@cup.kalibalik.dk","threadId":"17362","inReplyTo":"1232927133-30377-1-git-send-email-mail@cup.kalibalik.dk","subject":"[PATCH 1/3] Documentation: simplify refspec format description","fromName":"Anders Melchiorsen","fromEmail":"mail@cup.kalibalik.dk","sentAt":"2009-01-25T23:45:31Z","receivedAt":"2009-01-25T23:45:31Z","isPatch":true,"sender":{"key":"mail@cup.kalibalik.dk","avatar":null},"body":"The refspec format description was a mix of regexp and BNF, making it\nvery difficult to read. The format was also wrong: it did not show\nthat each part of a refspec is optional in different situations.\n\nRather than having a confusing grammar, just present the format in\ninformal prose.\n\nSigned-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>\n---\n\nThis is a rework of\nhttp://article.gmane.org/gmane.comp.version-control.git/99552/\n\n\n Documentation/git-push.txt         |    8 ++++----\n Documentation/pull-fetch-param.txt |    8 ++++----\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 7b27dc6..3fd4bbb 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -33,10 +33,10 @@ OPTIONS\n \tof a remote (see the section <<REMOTES,REMOTES>> below).\n \n <refspec>...::\n-\tThe canonical format of a <refspec> parameter is\n-\t`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed\n-\tby the source ref, followed by a colon `:`, followed by\n-\tthe destination ref.\n+\tThe format of a <refspec> parameter is an optional plus\n+\t`{plus}`, followed by the source ref <src>, followed\n+\tby a colon `:`, followed by the destination ref <dst>.\n+\tFind various forms of refspecs in examples section.\n +\n The <src> side represents the source branch (or arbitrary\n \"SHA1 expression\", such as `master~4` (four parents before the\ndiff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt\nindex ebdd948..820c140 100644\n--- a/Documentation/pull-fetch-param.txt\n+++ b/Documentation/pull-fetch-param.txt\n@@ -5,10 +5,10 @@\n \tof a remote (see the section <<REMOTES,REMOTES>> below).\n \n <refspec>::\n-\tThe canonical format of a <refspec> parameter is\n-\t`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed\n-\tby the source ref, followed by a colon `:`, followed by\n-\tthe destination ref.\n+\tThe format of a <refspec> parameter is an optional plus\n+\t`{plus}`, followed by the source ref <src>, followed\n+\tby a colon `:`, followed by the destination ref <dst>.\n+\tFind various forms of refspecs in examples section.\n +\n The remote ref that matches <src>\n is fetched, and if <dst> is not empty string, the local\n-- \n1.6.0.2.514.g23abd3\n"},{"id":"101911","messageId":"1232927133-30377-3-git-send-email-mail@cup.kalibalik.dk","threadId":"17362","inReplyTo":"1232927133-30377-2-git-send-email-mail@cup.kalibalik.dk","subject":"[PATCH 2/3] Documentation: more git push examples","fromName":"Anders Melchiorsen","fromEmail":"mail@cup.kalibalik.dk","sentAt":"2009-01-25T23:45:32Z","receivedAt":"2009-01-25T23:45:32Z","isPatch":true,"sender":{"key":"mail@cup.kalibalik.dk","avatar":null},"body":"Include examples of using HEAD. The order of examples\nintroduces new concepts one by one. This pushes the\nexample of deleting a ref to the end of the list.\n\n---\n Documentation/git-push.txt |   16 +++++++++++++---\n 1 files changed, 13 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 3fd4bbb..6d478c5 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -190,9 +190,9 @@ git push origin master::\n \twith it.  If `master` did not exist remotely, it would be\n \tcreated.\n \n-git push origin :experimental::\n-\tFind a ref that matches `experimental` in the `origin` repository\n-\t(e.g. `refs/heads/experimental`), and delete it.\n+git push origin HEAD::\n+\tA handy way to push the current branch to the same name on the\n+\tremote.\n \n git push origin master:satellite/master dev:satellite/dev::\n \tUse the source ref that matches `master` (e.g. `refs/heads/master`)\n@@ -200,6 +200,11 @@ git push origin master:satellite/master dev:satellite/dev::\n \t`refs/remotes/satellite/master`) in the `origin` repository, then\n \tdo the same for `dev` and `satellite/dev`.\n \n+git push origin HEAD:master::\n+\tPush the current branch to the remote ref matching `master` in the\n+\t`origin` repository. This form is convenient to push the current\n+\tbranch without thinking about its local name.\n+\n git push origin master:refs/heads/experimental::\n \tCreate the branch `experimental` in the `origin` repository\n \tby copying the current `master` branch.  This form is only\n@@ -207,6 +212,11 @@ git push origin master:refs/heads/experimental::\n \tthe local name and the remote name are different; otherwise,\n \tthe ref name on its own will work.\n \n+git push origin :experimental::\n+\tFind a ref that matches `experimental` in the `origin` repository\n+\t(e.g. `refs/heads/experimental`), and delete it.\n+\n+\n Author\n ------\n Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C\n-- \n1.6.0.2.514.g23abd3\n"},{"id":"101913","messageId":"1232927133-30377-4-git-send-email-mail@cup.kalibalik.dk","threadId":"17362","inReplyTo":"1232927133-30377-3-git-send-email-mail@cup.kalibalik.dk","subject":"[PATCH 3/3] Documentation: rework src/dst description in git push","fromName":"Anders Melchiorsen","fromEmail":"mail@cup.kalibalik.dk","sentAt":"2009-01-25T23:45:33Z","receivedAt":"2009-01-25T23:45:33Z","isPatch":true,"sender":{"key":"mail@cup.kalibalik.dk","avatar":null},"body":"This tries to make the description of ref matching in git push easier\nto read. Beauty is in the eye of the beholder, though.\n\nSigned-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>\n---\n\nThis is a followup to\nhttp://article.gmane.org/gmane.comp.version-control.git/99553/\n\n\n Documentation/git-push.txt |   23 ++++++++++++-----------\n 1 files changed, 12 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 6d478c5..1b3de4f 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -38,20 +38,21 @@ OPTIONS\n \tby a colon `:`, followed by the destination ref <dst>.\n \tFind various forms of refspecs in examples section.\n +\n-The <src> side represents the source branch (or arbitrary\n-\"SHA1 expression\", such as `master~4` (four parents before the\n-tip of `master` branch); see linkgit:git-rev-parse[1]) that you\n-want to push.  The <dst> side represents the destination location.\n+The <src> is often the name of the branch you would want to push, but\n+it can be any arbitrary \"SHA-1 expression\", such as `master~4` or\n+`HEAD` (see linkgit:git-rev-parse[1]).\n +\n-The local ref that matches <src> is used\n-to fast forward the remote ref that matches <dst>.  If\n-the optional leading plus `+` is used, the remote ref is updated\n-even if it does not result in a fast forward update.\n+The <dst> tells which ref on the remote side is updated with this\n+push. Arbitrary expressions cannot be used here, an actual ref must\n+be named. If `:`<dst> is omitted, the same ref as <src> will be\n+updated.\n +\n-`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.\n+The object referenced by <src> is used to fast forward the ref <dst>\n+on the remote side. If the optional leading plus `{plus}` is used, the\n+remote ref is updated even if it does not result in a fast forward\n+update.\n +\n-A lonely <src> parameter (without a colon and a destination) pushes\n-the <src> to the same name in the destination repository.\n+`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.\n +\n Pushing an empty <src> allows you to delete the <dst> ref from\n the remote repository.\n-- \n1.6.0.2.514.g23abd3\n"},{"id":"101944","messageId":"7viqo2a8l5.fsf@gitster.siamese.dyndns.org","threadId":"17362","inReplyTo":"1232927133-30377-2-git-send-email-mail@cup.kalibalik.dk","subject":"Re: [PATCH 1/3] Documentation: simplify refspec format description","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-26T06:24:06Z","receivedAt":"2009-01-26T06:24:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Anders Melchiorsen <mail@cup.kalibalik.dk> writes:\n\n> diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt\n> index ebdd948..820c140 100644\n> --- a/Documentation/pull-fetch-param.txt\n> +++ b/Documentation/pull-fetch-param.txt\n> @@ -5,10 +5,10 @@\n>  \tof a remote (see the section <<REMOTES,REMOTES>> below).\n>  \n>  <refspec>::\n> -\tThe canonical format of a <refspec> parameter is\n> -\t`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed\n> -\tby the source ref, followed by a colon `:`, followed by\n> -\tthe destination ref.\n> +\tThe format of a <refspec> parameter is an optional plus\n> +\t`{plus}`, followed by the source ref <src>, followed\n> +\tby a colon `:`, followed by the destination ref <dst>.\n> +\tFind various forms of refspecs in examples section.\n>  +\n>  The remote ref that matches <src>\n>  is fetched, and if <dst> is not empty string, the local\n\nI think this is *much* nicer, but I do not think git-fetch.txt has\nexamples to fall back on.\n\nThe patch to git-push.txt would not have this issue; the exmaple is there\nin the page itself.\n\nBut I think it might be even better to briefly describe what it means,\nlike this patch on top of yours does to git-push.txt.  The fetch/pull side\nalready has the corresponding description immediately after that, so I'd\nsuggest just removing the reference to non-existing examples section.\n\nI found your 2/3 and 3/3 good improvements.\n\n Documentation/git-push.txt         |    3 ++-\n Documentation/pull-fetch-param.txt |    3 +--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git i/Documentation/git-push.txt w/Documentation/git-push.txt\nindex 3fd4bbb..ea45935 100644\n--- i/Documentation/git-push.txt\n+++ w/Documentation/git-push.txt\n@@ -36,7 +36,8 @@ OPTIONS\n \tThe format of a <refspec> parameter is an optional plus\n \t`{plus}`, followed by the source ref <src>, followed\n \tby a colon `:`, followed by the destination ref <dst>.\n-\tFind various forms of refspecs in examples section.\n+\tIt is used to specify with what <src> object the <dst> ref\n+\tin the remote repository is to be updated.\n +\n The <src> side represents the source branch (or arbitrary\n \"SHA1 expression\", such as `master~4` (four parents before the\ndiff --git i/Documentation/pull-fetch-param.txt w/Documentation/pull-fetch-param.txt\nindex 820c140..f9811f2 100644\n--- i/Documentation/pull-fetch-param.txt\n+++ w/Documentation/pull-fetch-param.txt\n@@ -8,12 +8,11 @@\n \tThe format of a <refspec> parameter is an optional plus\n \t`{plus}`, followed by the source ref <src>, followed\n \tby a colon `:`, followed by the destination ref <dst>.\n-\tFind various forms of refspecs in examples section.\n +\n The remote ref that matches <src>\n is fetched, and if <dst> is not empty string, the local\n ref that matches it is fast forwarded using <src>.\n-Again, if the optional plus `+` is used, the local ref\n+If the optional plus `+` is used, the local ref\n is updated even if it does not result in a fast forward\n update.\n +\n"}]}