{"thread":{"id":"33086","subject":"[PATCH] git-push.txt: mention about remote.*.push when no refspec is given","startedAt":"2013-03-06T12:44:08Z","lastAt":"2013-03-08T17:59:15Z","messageCount":4,"participants":["Nguyễn Thái Ngọc Duy","Junio C Hamano","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"210695","messageId":"1362573848-21793-1-git-send-email-pclouds@gmail.com","threadId":"33086","inReplyTo":null,"subject":"[PATCH] git-push.txt: mention about remote.*.push when no refspec is given","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-03-06T12:44:08Z","receivedAt":"2013-03-06T12:44:08Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"remote.*.push is considered before push.default, but there's no\nmention about that, except a bit in the examples. The description\nof push.default does say something about this, but it would be easier\nto find out if it's described here.\n\nThe first paragraph describing refspec format is moved down, so that\nthe new first paragraph is about unspsecified refspec and the\nremaining paragraphs refspec format.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/git-push.txt | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 1398025..20bf2f5 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -33,13 +33,16 @@ OPTIONS[[OPTIONS]]\n \tof a remote (see the section <<REMOTES,REMOTES>> below).\n \n <refspec>...::\n-\tThe format of a <refspec> parameter is an optional plus\n-\t`+`, followed by the source ref <src>, followed\n-\tby a colon `:`, followed by the destination ref <dst>.\n-\tIt is used to specify with what <src> object the <dst> ref\n-\tin the remote repository is to be updated.  If not specified,\n-\tthe behavior of the command is controlled by the `push.default`\n-\tconfiguration variable.\n+\tSpecify how how refs are pushed. If not specified and\n+\tconfiguration variable `remote.<remote>.push` is set, the\n+\tvariable is used as default refspec. If not specified and the\n+\tvariable is not set, the behavior of the command is controlled\n+\tby the `push.default` configuration variable.\n++\n+The format of a <refspec> parameter is an optional plus `+`, followed\n+by the source ref <src>, followed by a colon `:`, followed by the\n+destination ref <dst>.  It is used to specify with what <src> object\n+the <dst> ref in the remote repository is to be updated.\n +\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-- \n1.8.1.2.536.gf441e6d\n"},{"id":"210704","messageId":"7v8v60qu2i.fsf@alter.siamese.dyndns.org","threadId":"33086","inReplyTo":"1362573848-21793-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-06T18:09:09Z","receivedAt":"2013-03-06T18:09:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> remote.*.push is considered before push.default, but there's no\n> mention about that, except a bit in the examples. The description\n> of push.default does say something about this, but it would be easier\n> to find out if it's described here.\n>\n> The first paragraph describing refspec format is moved down, so that\n> the new first paragraph is about unspsecified refspec and the\n> remaining paragraphs refspec format.\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Documentation/git-push.txt | 17 ++++++++++-------\n>  1 file changed, 10 insertions(+), 7 deletions(-)\n>\n> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> index 1398025..20bf2f5 100644\n> --- a/Documentation/git-push.txt\n> +++ b/Documentation/git-push.txt\n> @@ -33,13 +33,16 @@ OPTIONS[[OPTIONS]]\n>  \tof a remote (see the section <<REMOTES,REMOTES>> below).\n>  \n>  <refspec>...::\n> -\tThe format of a <refspec> parameter is an optional plus\n> -\t`+`, followed by the source ref <src>, followed\n> -\tby a colon `:`, followed by the destination ref <dst>.\n> -\tIt is used to specify with what <src> object the <dst> ref\n> -\tin the remote repository is to be updated.  If not specified,\n> -\tthe behavior of the command is controlled by the `push.default`\n> -\tconfiguration variable.\n> +\tSpecify how how refs are pushed. If not specified and\n> +\tconfiguration variable `remote.<remote>.push` is set, the\n> +\tvariable is used as default refspec. If not specified and the\n> +\tvariable is not set, the behavior of the command is controlled\n> +\tby the `push.default` configuration variable.\n> ++\n> +The format of a <refspec> parameter is an optional plus `+`, followed\n> +by the source ref <src>, followed by a colon `:`, followed by the\n> +destination ref <dst>.  It is used to specify with what <src> object\n> +the <dst> ref in the remote repository is to be updated.\n\nI agree that saying what it is, what it does or what it is for\nupfront (i.e. \"Specifies what are pushed\") before how it is spelled\nis an improvement.  I however think describing \"If not specified\"\nhere was a mistake, and you are making it worse by burying the\ndescription of what happens when <refspec>... are missing in the\nmiddle of the description for <refspec>...\n\nI would rather see this done in the direction the attached \"how\nabout doing it this way\" patch illustrates.  The way how \"where\" and\n\"what\" are determined when the command line does not specify is the\nproparty of the entire command, not of an individual parameter.\n\n\n Documentation/git-push.txt | 23 ++++++++++++++---------\n 1 file changed, 14 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 1398025..31dad19 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -23,6 +23,17 @@ You can make interesting things happen to a repository\n every time you push into it, by setting up 'hooks' there.  See\n documentation for linkgit:git-receive-pack[1].\n \n+When the user does not specify where to push with\n+<repository> argument, branch.*.remote configuration for the current\n+branch is consulted to determine where to push.  If the\n+configuration is missing, it defaults to 'origin'.\n+\n+When the user does not specify what to push with\n+<refspec>... arguments or --all/--mirror/--tags options, the command finds\n+the default <refspec> by consulting remote.*.push configuration, and\n+if it is not found, honors push.default configuration to decide what\n+to push (See gitlink:git-config[1] for the meaning of push.default).\n+\n \n OPTIONS[[OPTIONS]]\n ------------------\n@@ -33,13 +44,10 @@ OPTIONS[[OPTIONS]]\n \tof a remote (see the section <<REMOTES,REMOTES>> below).\n \n <refspec>...::\n+\tSpecify what destination ref to update with what source object.\n \tThe format of a <refspec> parameter is an optional plus\n-\t`+`, followed by the source ref <src>, followed\n+\t`+`, followed by the source object <src>, followed\n \tby a colon `:`, followed by the destination ref <dst>.\n-\tIt is used to specify with what <src> object the <dst> ref\n-\tin the remote repository is to be updated.  If not specified,\n-\tthe behavior of the command is controlled by the `push.default`\n-\tconfiguration variable.\n +\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@@ -66,10 +74,7 @@ the remote repository.\n The special refspec `:` (or `+:` to allow non-fast-forward updates)\n directs Git to push \"matching\" branches: for every branch that exists on\n the local side, the remote side is updated if a branch of the same name\n-already exists on the remote side.  This is the default operation mode\n-if no explicit refspec is found (that is neither on the command line\n-nor in any Push line of the corresponding remotes file---see below) and\n-no `push.default` configuration variable is set.\n+already exists on the remote side.\n \n --all::\n \tInstead of naming each ref to push, specifies that all\n"},{"id":"210830","messageId":"CACsJy8BNpMN3-Y1eZrJXpZp3-KU=kDN_4eM=87OD9d7yYYrHCg@mail.gmail.com","threadId":"33086","inReplyTo":"7v8v60qu2i.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-03-08T10:58:54Z","receivedAt":"2013-03-08T10:58:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Mar 7, 2013 at 1:09 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> I agree that saying what it is, what it does or what it is for\n> upfront (i.e. \"Specifies what are pushed\") before how it is spelled\n> is an improvement.  I however think describing \"If not specified\"\n> here was a mistake, and you are making it worse by burying the\n> description of what happens when <refspec>... are missing in the\n> middle of the description for <refspec>...\n>\n> I would rather see this done in the direction the attached \"how\n> about doing it this way\" patch illustrates.  The way how \"where\" and\n> \"what\" are determined when the command line does not specify is the\n> proparty of the entire command, not of an individual parameter.\n\nI agree your patch looks better than mine. Put it on 'pu', perhaps?\n-- \nDuy\n"},{"id":"210844","messageId":"7v38w5hix8.fsf@alter.siamese.dyndns.org","threadId":"33086","inReplyTo":"CACsJy8BNpMN3-Y1eZrJXpZp3-KU=kDN_4eM=87OD9d7yYYrHCg@mail.gmail.com","subject":"Re: [PATCH] git-push.txt: mention about remote.*.push when no refspec is given","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-08T17:59:15Z","receivedAt":"2013-03-08T17:59:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> On Thu, Mar 7, 2013 at 1:09 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I agree that saying what it is, what it does or what it is for\n>> upfront (i.e. \"Specifies what are pushed\") before how it is spelled\n>> is an improvement.  I however think describing \"If not specified\"\n>> here was a mistake, and you are making it worse by burying the\n>> description of what happens when <refspec>... are missing in the\n>> middle of the description for <refspec>...\n>>\n>> I would rather see this done in the direction the attached \"how\n>> about doing it this way\" patch illustrates.  The way how \"where\" and\n>> \"what\" are determined when the command line does not specify is the\n>> proparty of the entire command, not of an individual parameter.\n>\n> I agree your patch looks better than mine. Put it on 'pu', perhaps?\n\nHeh, that's not my itch ;-)\n\n-- >8 --\nSubject: [PATCH] Documentation/git-push: clarify the description of defaults\n\nWe describe what gets pushed by default when the command line does\nnot give any <refspec> under the bullet point of <refspec>.\n\nIt is a bit unfriendly to expect users to read on <refspec> when\nthey are not giving any in the first place.  \"What gets pushed\" is\ndetermined by taking many factors (<refspec> argument being only one\nof them) into account, and is a property of the entire command, not\nan individual argument.  Also we do not describe \"Where the push\ngoes\" when the command line does not say.\n\nGive the description on \"what gets pushed to where\" upfront before\nexplaining individual arguments and options.\n\nAlso update the description of <refspec> to say what it is, what it\nis used for, before explaining what shape it takes.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-push.txt | 23 ++++++++++++++---------\n 1 file changed, 14 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 8b637d3..3b41e72 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -23,6 +23,17 @@ You can make interesting things happen to a repository\n every time you push into it, by setting up 'hooks' there.  See\n documentation for linkgit:git-receive-pack[1].\n \n+When the command line does not specify where to push with the\n+`<repository>` argument, `branch.*.remote` configuration for the\n+current branch is consulted to determine where to push.  If the\n+configuration is missing, it defaults to 'origin'.\n+\n+When the command line does not specify what to push with `<refspec>...`\n+arguments or `--all`, `--mirror`, `--tags` options, the command finds\n+the default `<refspec>` by consulting `remote.*.push` configuration,\n+and if it is not found, honors `push.default` configuration to decide\n+what to push (See gitlink:git-config[1] for the meaning of `push.default`).\n+\n \n OPTIONS[[OPTIONS]]\n ------------------\n@@ -33,13 +44,10 @@ OPTIONS[[OPTIONS]]\n \tof a remote (see the section <<REMOTES,REMOTES>> below).\n \n <refspec>...::\n+\tSpecify what destination ref to update with what source object.\n \tThe format of a <refspec> parameter is an optional plus\n-\t`+`, followed by the source ref <src>, followed\n+\t`+`, followed by the source object <src>, followed\n \tby a colon `:`, followed by the destination ref <dst>.\n-\tIt is used to specify with what <src> object the <dst> ref\n-\tin the remote repository is to be updated.  If not specified,\n-\tthe behavior of the command is controlled by the `push.default`\n-\tconfiguration variable.\n +\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@@ -65,10 +73,7 @@ the remote repository.\n The special refspec `:` (or `+:` to allow non-fast-forward updates)\n directs git to push \"matching\" branches: for every branch that exists on\n the local side, the remote side is updated if a branch of the same name\n-already exists on the remote side.  This is the default operation mode\n-if no explicit refspec is found (that is neither on the command line\n-nor in any Push line of the corresponding remotes file---see below) and\n-no `push.default` configuration variable is set.\n+already exists on the remote side.\n \n --all::\n \tInstead of naming each ref to push, specifies that all\n-- \n1.8.2-rc3-243-g6506aa2\n"}]}