{"thread":{"id":"55270","subject":"remote.<name>.merge missing from the git-config man page?","startedAt":"2021-03-08T12:11:39Z","lastAt":"2021-03-13T08:00:40Z","messageCount":14,"participants":["Fabien Terrani","Eric Sunshine","Junio C Hamano","Taylor Blau","Andreas Schwab","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"418434","messageId":"CAOuwed4HJLTgk48Fre5vGYjYanqD6hu8yZM73CpcAmF1ajiTnA@mail.gmail.com","threadId":"55270","inReplyTo":null,"subject":"remote.<name>.merge missing from the git-config man page?","fromName":"Fabien Terrani","fromEmail":"terranifabien@gmail.com","sentAt":"2021-03-08T12:10:25Z","receivedAt":"2021-03-08T12:11:39Z","isPatch":false,"sender":{"key":"terranifabien@gmail.com","avatar":null},"body":"Hi all,\n\nI was recently trying to understand the git-push command's behavior,\nespecially regarding the configuration values's resolution. I read the\nfollowing in the EXAMPLES section of the git-push man page:\n\n> git push origin\n>     Without additional configuration, pushes the current branch to the configured upstream (remote.origin.merge configuration variable) if it has the same name as the current branch, and errors out without pushing otherwise.\n\nI then had a look at the git-config man page and I was surprised to\nnotice that there was no documentation at all about a\nremote.<name>.merge or remote.origin.merge configuration value. I am\ndefinitely not a git expert but this looks strange to me. Am I missing\nsomething? Is remote.<name>.merge used by git at all?\n\n(before mailing here, I tried carefully examining git's source code to\nsee if there was a remote.<name>.merge value used somewhere. I can't\nbe 100% positive since this was very complex to me, but I personally\ncouldn't find anything referencing remote.<name>.merge, while I found\ncode using other values like remote.<name>.push, push.default etc.)\n\n\nBest regards\n"},{"id":"418480","messageId":"CAPig+cR13JTmLmjk=g8sFowEY2zNZiqVFCHOCYnQ9LX5URjdGA@mail.gmail.com","threadId":"55270","inReplyTo":"CAOuwed4HJLTgk48Fre5vGYjYanqD6hu8yZM73CpcAmF1ajiTnA@mail.gmail.com","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-03-08T16:57:19Z","receivedAt":"2021-03-08T16:58:30Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"[cc:+adam +phillipe]\n\nOn Mon, Mar 8, 2021 at 7:11 AM Fabien Terrani <terranifabien@gmail.com> wrote:\n> I was recently trying to understand the git-push command's behavior,\n> especially regarding the configuration values's resolution. I read the\n> following in the EXAMPLES section of the git-push man page:\n>\n> > git push origin\n> >     Without additional configuration, pushes the current branch to the configured upstream (remote.origin.merge configuration variable) if it has the same name as the current branch, and errors out without pushing otherwise.\n>\n> I then had a look at the git-config man page and I was surprised to\n> notice that there was no documentation at all about a\n> remote.<name>.merge or remote.origin.merge configuration value. I am\n> definitely not a git expert but this looks strange to me. Am I missing\n> something? Is remote.<name>.merge used by git at all?\n\nYours is the second report[1] about this in a few weeks.\n\n> (before mailing here, I tried carefully examining git's source code to\n> see if there was a remote.<name>.merge value used somewhere. I can't\n> be 100% positive since this was very complex to me, but I personally\n> couldn't find anything referencing remote.<name>.merge, while I found\n> code using other values like remote.<name>.push, push.default etc.)\n\nI spent a bit of time going through the source code, as well, trying\nto determine the correct name of this variable but didn't arrive at an\nanswer before having to turn to other tasks.\n\nHopefully, someone more familiar with this area of the project can\nchime in with the correct answer and more useful response.\n\n[1]: https://lore.kernel.org/git/CAAxrY9yjTKV8-K0AmO4fBmtDrSB4KkN_xKOMmtSb-dvixJNaEQ@mail.gmail.com/T/\n"},{"id":"418484","messageId":"xmqqlfax7dya.fsf@gitster.c.googlers.com","threadId":"55270","inReplyTo":"CAOuwed4HJLTgk48Fre5vGYjYanqD6hu8yZM73CpcAmF1ajiTnA@mail.gmail.com","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-03-08T17:27:57Z","receivedAt":"2021-03-08T17:28:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fabien Terrani <terranifabien@gmail.com> writes:\n\n> I was recently trying to understand the git-push command's behavior,\n> especially regarding the configuration values's resolution. I read the\n> following in the EXAMPLES section of the git-push man page:\n>\n>> git push origin\n\n>>     Without additional configuration, pushes the current branch\n>>     to the configured upstream (remote.origin.merge configuration\n>>     variable) if it has the same name as the current branch, and\n>>     errors out without pushing otherwise.\n\nHmph, it seems it talks about the branch on the remote side that is\nconfigured for the current branch to integrate with.  Most likely\nthat is misspelt \"branch.<name>.merge\" where <name> is the name of\nthe branch currently checked out.\n\nThe text comes from b2ed944a (push: switch default from \"matching\"\nto \"simple\", 2013-01-04); I am a bit surprised how such a typo\nsurvived this long ;-)\n\n"},{"id":"418502","messageId":"YEZwY0721KvQNkK+@nand.local","threadId":"55270","inReplyTo":"xmqqlfax7dya.fsf@gitster.c.googlers.com","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-03-08T18:43:47Z","receivedAt":"2021-03-08T18:44:32Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Mar 08, 2021 at 09:27:57AM -0800, Junio C Hamano wrote:\n> >> git push origin\n>\n> >>     Without additional configuration, pushes the current branch\n> >>     to the configured upstream (remote.origin.merge configuration\n> >>     variable) if it has the same name as the current branch, and\n> >>     errors out without pushing otherwise.\n>\n> Hmph, it seems it talks about the branch on the remote side that is\n> configured for the current branch to integrate with.  Most likely\n> that is misspelt \"branch.<name>.merge\" where <name> is the name of\n> the branch currently checked out.\n\nI agree; this should definitely refer to \"branch.<name>.merge\", not\n\"remote.<name>.merge\" (which to my knowledge has never existed).\n\nI had to double check that this \"without additional configuration\" is\nright. Indeed:\n\n  - The default value of the 'push.default' variable is \"simple\", which\n    in a non-triangular workflow calls\n    \"builtin/push.c:setup_push_upstream()\".\n\n  - 'setup_push_upstream()' dies on L213 if strcmp(branch->refname,\n    branch->merge[0]->src).\n\n  - Othewrise, it sets up the expected refspec (to push the local branch\n    to the remote branch 'branch.<name>.merge').\n\n> The text comes from b2ed944a (push: switch default from \"matching\"\n> to \"simple\", 2013-01-04); I am a bit surprised how such a typo\n> survived this long ;-)\n\nMe too :). Here's a patch to rectify the confusion:\n\n--- >8 ---\n\nSubject: [PATCH] Documentation/git-push.txt: correct configuration typo\n\nIn the EXAMPLES section, git-push(1) says that 'git push origin' pushes\nthe current branch to the value of the 'remote.origin.merge'\nconfiguration.\n\nThis wording (which dates back to b2ed944af7 (push: switch default from\n\"matching\" to \"simple\", 2013-01-04)) is incorrect. There is no such\nconfiguration as 'remote.<name>.merge'. This likely was originally\nintended to read \"branch.<name>.merge\" instead.\n\nIndeed, when 'push.default' is 'simple' (which is the default value, and\nis applicable in this scenario per \"without additional configuration\"),\nsetup_push_upstream() dies if the branch's local name does not match\n'branch.<name>.merge'.\n\nCorrect this long-standing typo to resolve some recent confusion on the\nintended behavior of this example.\n\nReported-by: Adam Sharafeddine <adam.shrfdn@gmail.com>\nReported-by: Fabien Terrani <terranifabien@gmail.com>\nSigned-off-by: Taylor Blau <me@ttaylorr.com>\n---\n Documentation/git-push.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex ab103c82cf..a953c7c387 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -600,7 +600,7 @@ EXAMPLES\n\n `git push origin`::\n \tWithout additional configuration, pushes the current branch to\n-\tthe configured upstream (`remote.origin.merge` configuration\n+\tthe configured upstream (`branch.<name>.merge` configuration\n \tvariable) if it has the same name as the current branch, and\n \terrors out without pushing otherwise.\n +\n--\n2.30.0.667.g81c0cbc6fd\n\n"},{"id":"418523","messageId":"87pn092yja.fsf@igel.home","threadId":"55270","inReplyTo":"YEZwY0721KvQNkK+@nand.local","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2021-03-08T20:14:33Z","receivedAt":"2021-03-08T20:15:21Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Mär 08 2021, Taylor Blau wrote:\n\n> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> index ab103c82cf..a953c7c387 100644\n> --- a/Documentation/git-push.txt\n> +++ b/Documentation/git-push.txt\n> @@ -600,7 +600,7 @@ EXAMPLES\n>\n>  `git push origin`::\n>  \tWithout additional configuration, pushes the current branch to\n> -\tthe configured upstream (`remote.origin.merge` configuration\n> +\tthe configured upstream (`branch.<name>.merge` configuration\n>  \tvariable) if it has the same name as the current branch, and\n>  \terrors out without pushing otherwise.\n\nThat doesn't say what <name> is.  Is that supposed to be <branch>?\nAlso, what is \"it\" referring to in \"if it has the same name\"?\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"418525","messageId":"YEaI5JIobsbtBQO1@nand.local","threadId":"55270","inReplyTo":"87pn092yja.fsf@igel.home","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-03-08T20:28:20Z","receivedAt":"2021-03-08T20:29:22Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Mar 08, 2021 at 09:14:33PM +0100, Andreas Schwab wrote:\n> On Mär 08 2021, Taylor Blau wrote:\n>\n> > diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> > index ab103c82cf..a953c7c387 100644\n> > --- a/Documentation/git-push.txt\n> > +++ b/Documentation/git-push.txt\n> > @@ -600,7 +600,7 @@ EXAMPLES\n> >\n> >  `git push origin`::\n> >  \tWithout additional configuration, pushes the current branch to\n> > -\tthe configured upstream (`remote.origin.merge` configuration\n> > +\tthe configured upstream (`branch.<name>.merge` configuration\n> >  \tvariable) if it has the same name as the current branch, and\n> >  \terrors out without pushing otherwise.\n>\n> That doesn't say what <name> is.  Is that supposed to be <branch>?\n> Also, what is \"it\" referring to in \"if it has the same name\"?\n\n<name> refers to the currently-checked-out branch's local name. (That's\nhow it's used in Documentation/config/branch.txt).\n\nThe antecedent is \"the current branch\", so I think that this one may\nalready be quite clear if you read past the parenthesis.\n\nThanks,\nTaylor\n"},{"id":"418527","messageId":"87lfax2xat.fsf@igel.home","threadId":"55270","inReplyTo":"YEaI5JIobsbtBQO1@nand.local","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2021-03-08T20:41:14Z","receivedAt":"2021-03-08T20:42:21Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Mär 08 2021, Taylor Blau wrote:\n\n> On Mon, Mar 08, 2021 at 09:14:33PM +0100, Andreas Schwab wrote:\n>> On Mär 08 2021, Taylor Blau wrote:\n>>\n>> > diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n>> > index ab103c82cf..a953c7c387 100644\n>> > --- a/Documentation/git-push.txt\n>> > +++ b/Documentation/git-push.txt\n>> > @@ -600,7 +600,7 @@ EXAMPLES\n>> >\n>> >  `git push origin`::\n>> >  \tWithout additional configuration, pushes the current branch to\n>> > -\tthe configured upstream (`remote.origin.merge` configuration\n>> > +\tthe configured upstream (`branch.<name>.merge` configuration\n>> >  \tvariable) if it has the same name as the current branch, and\n>> >  \terrors out without pushing otherwise.\n>>\n>> That doesn't say what <name> is.  Is that supposed to be <branch>?\n>> Also, what is \"it\" referring to in \"if it has the same name\"?\n>\n> <name> refers to the currently-checked-out branch's local name. (That's\n> how it's used in Documentation/config/branch.txt).\n>\n> The antecedent is \"the current branch\", so I think that this one may\n> already be quite clear if you read past the parenthesis.\n\nThat doesn't make sense: \"if the current branch has the same name as the\ncurrent branch\".\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"418528","messageId":"YEaM7ruZCvaQQbPI@nand.local","threadId":"55270","inReplyTo":"87lfax2xat.fsf@igel.home","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-03-08T20:45:34Z","receivedAt":"2021-03-08T20:46:39Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Mar 08, 2021 at 09:41:14PM +0100, Andreas Schwab wrote:\n> >> >  `git push origin`::\n> >> >  \tWithout additional configuration, pushes the current branch to\n> >> > -\tthe configured upstream (`remote.origin.merge` configuration\n> >> > +\tthe configured upstream (`branch.<name>.merge` configuration\n> >> >  \tvariable) if it has the same name as the current branch, and\n> >> >  \terrors out without pushing otherwise.\n> >>\n> >> That doesn't say what <name> is.  Is that supposed to be <branch>?\n> >> Also, what is \"it\" referring to in \"if it has the same name\"?\n> >\n> > <name> refers to the currently-checked-out branch's local name. (That's\n> > how it's used in Documentation/config/branch.txt).\n> >\n> > The antecedent is \"the current branch\", so I think that this one may\n> > already be quite clear if you read past the parenthesis.\n>\n> That doesn't make sense: \"if the current branch has the same name as the\n> current branch\".\n\nOK, now I see where your confusion is. I was incorrect in saying the\nantecedent was \"the current branch\"; it should instead by \"the\nconfigured upstream\". IOW, \"if both your and the remote copy call the\nbranch you have checked out the same thing.\"\n\nRe-reading the original wording, I still think that it is clear enough\nto communicate what I wrote above, but if there is an alternative\nwording you find clearer, I would certainly welcome suggestions.\n\nThanks,\nTaylor\n"},{"id":"418533","messageId":"87h7ll2wiz.fsf@igel.home","threadId":"55270","inReplyTo":"YEaM7ruZCvaQQbPI@nand.local","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2021-03-08T20:57:56Z","receivedAt":"2021-03-08T20:59:02Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Mär 08 2021, Taylor Blau wrote:\n\n> On Mon, Mar 08, 2021 at 09:41:14PM +0100, Andreas Schwab wrote:\n>> >> >  `git push origin`::\n>> >> >  \tWithout additional configuration, pushes the current branch to\n>> >> > -\tthe configured upstream (`remote.origin.merge` configuration\n>> >> > +\tthe configured upstream (`branch.<name>.merge` configuration\n>> >> >  \tvariable) if it has the same name as the current branch, and\n>> >> >  \terrors out without pushing otherwise.\n>> >>\n>> >> That doesn't say what <name> is.  Is that supposed to be <branch>?\n>> >> Also, what is \"it\" referring to in \"if it has the same name\"?\n>> >\n>> > <name> refers to the currently-checked-out branch's local name. (That's\n>> > how it's used in Documentation/config/branch.txt).\n>> >\n>> > The antecedent is \"the current branch\", so I think that this one may\n>> > already be quite clear if you read past the parenthesis.\n>>\n>> That doesn't make sense: \"if the current branch has the same name as the\n>> current branch\".\n>\n> OK, now I see where your confusion is. I was incorrect in saying the\n> antecedent was \"the current branch\"; it should instead by \"the\n> configured upstream\". IOW, \"if both your and the remote copy call the\n> branch you have checked out the same thing.\"\n\nThe configured upstream is the value of branch.<name>.merge, isn't it?\nThat would be the name of a remote, not the name of a branch.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"418535","messageId":"YEaRw5x5hnh9RRyM@nand.local","threadId":"55270","inReplyTo":"87h7ll2wiz.fsf@igel.home","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-03-08T21:06:11Z","receivedAt":"2021-03-08T21:06:58Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Mon, Mar 08, 2021 at 09:57:56PM +0100, Andreas Schwab wrote:\n> The configured upstream is the value of branch.<name>.merge, isn't it?\n> That would be the name of a remote, not the name of a branch.\n\nRight; the '<name>' in 'branch.<name>.merge' is your local name for a\nbranch, but the value of that configuration is the remote's name.\n\n> Andreas.\n\nThanks,\nTaylor\n"},{"id":"418536","messageId":"xmqq8s6x5olt.fsf@gitster.c.googlers.com","threadId":"55270","inReplyTo":"YEaM7ruZCvaQQbPI@nand.local","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-03-08T21:20:46Z","receivedAt":"2021-03-08T21:21:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n> On Mon, Mar 08, 2021 at 09:41:14PM +0100, Andreas Schwab wrote:\n>> >> >  `git push origin`::\n>> >> >  \tWithout additional configuration, pushes the current branch to\n>> >> > -\tthe configured upstream (`remote.origin.merge` configuration\n>> >> > +\tthe configured upstream (`branch.<name>.merge` configuration\n>> >> >  \tvariable) if it has the same name as the current branch, and\n>> >> >  \terrors out without pushing otherwise.\n>\n> ... IOW, \"if both your and the remote copy call the\n> branch you have checked out the same thing.\"\n\nIntroducing a new term \"remote copy\" makes it even more confusing at\nleast to me.  And you are *not* checking out whatever branch any\nremote repository has.  Your 'master' and my 'master' are different\nentities.\n\nI actually wonder what configuration the paragraph considers\nfundamental and mandatory (as opposed to \"additional\" ones).\n\nAt the most basic \"I just ran 'git clone' from somewhere\" level,\nremote.origin.url would be set and, branch.master.remote and\nbranch.master.merge are present.\n\nI wonder if we should update the heading and extend the description\na bit further, e.g.\n\n\t`git push`::\n\t\tWithout additional configuration, uses the\n\t\t`branch.<name>.remote` configuration variable for\n\t\tthe branch that is currently checked-out to figure\n\t\tout which remote to push to, and pushes the current\n\t\tbranch to update their branch with the same name.\n\t\tIf `branch.<name>.merge` is set to a name different\n\t\tfrom `<name>`, however, errors out without pushing.\n\nso that it makes it clear that .remote and .merge come in pair.\n"},{"id":"418541","messageId":"87a6rd2tp8.fsf@igel.home","threadId":"55270","inReplyTo":"YEaRw5x5hnh9RRyM@nand.local","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2021-03-08T21:58:59Z","receivedAt":"2021-03-08T22:00:05Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Mär 08 2021, Taylor Blau wrote:\n\n> On Mon, Mar 08, 2021 at 09:57:56PM +0100, Andreas Schwab wrote:\n>> The configured upstream is the value of branch.<name>.merge, isn't it?\n>> That would be the name of a remote, not the name of a branch.\n>\n> Right; the '<name>' in 'branch.<name>.merge' is your local name for a\n> branch, but the value of that configuration is the remote's name.\n\nSorry, I was misreading branch.<name>.merge as branch.<name>.remote.\nNow it makes all sense to me.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"419020","messageId":"xmqq5z1w542n.fsf@gitster.g","threadId":"55270","inReplyTo":"87a6rd2tp8.fsf@igel.home","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-03-12T23:45:36Z","receivedAt":"2021-03-12T23:46:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> On Mär 08 2021, Taylor Blau wrote:\n>\n>> On Mon, Mar 08, 2021 at 09:57:56PM +0100, Andreas Schwab wrote:\n>>> The configured upstream is the value of branch.<name>.merge, isn't it?\n>>> That would be the name of a remote, not the name of a branch.\n>>\n>> Right; the '<name>' in 'branch.<name>.merge' is your local name for a\n>> branch, but the value of that configuration is the remote's name.\n>\n> Sorry, I was misreading branch.<name>.merge as branch.<name>.remote.\n> Now it makes all sense to me.\n\nOK, so do we have a version that is good to go?\n\nThanks.\n\n-- >8 --\nFrom: Taylor Blau <me@ttaylorr.com>\nDate: Mon, 8 Mar 2021 13:43:47 -0500\nSubject: [PATCH] Documentation/git-push.txt: correct configuration typo\n\nIn the EXAMPLES section, git-push(1) says that 'git push origin' pushes\nthe current branch to the value of the 'remote.origin.merge'\nconfiguration.\n\nThis wording (which dates back to b2ed944af7 (push: switch default from\n\"matching\" to \"simple\", 2013-01-04)) is incorrect. There is no such\nconfiguration as 'remote.<name>.merge'. This likely was originally\nintended to read \"branch.<name>.merge\" instead.\n\nIndeed, when 'push.default' is 'simple' (which is the default value, and\nis applicable in this scenario per \"without additional configuration\"),\nsetup_push_upstream() dies if the branch's local name does not match\n'branch.<name>.merge'.\n\nCorrect this long-standing typo to resolve some recent confusion on the\nintended behavior of this example.\n\nReported-by: Adam Sharafeddine <adam.shrfdn@gmail.com>\nReported-by: Fabien Terrani <terranifabien@gmail.com>\nSigned-off-by: Taylor Blau <me@ttaylorr.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\nNotes (amlog):\n    Message-Id: <YEZwY0721KvQNkK+@nand.local>\n\n Documentation/git-push.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex ab103c82cf..a953c7c387 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -600,7 +600,7 @@ EXAMPLES\n \n `git push origin`::\n \tWithout additional configuration, pushes the current branch to\n-\tthe configured upstream (`remote.origin.merge` configuration\n+\tthe configured upstream (`branch.<name>.merge` configuration\n \tvariable) if it has the same name as the current branch, and\n \terrors out without pushing otherwise.\n +\n-- \n2.31.0-rc2-171-g89112de4ba\n\n"},{"id":"419026","messageId":"YExw20PVRmwumMBx@google.com","threadId":"55270","inReplyTo":"xmqq5z1w542n.fsf@gitster.g","subject":"Re: remote.<name>.merge missing from the git-config man page?","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2021-03-13T07:59:23Z","receivedAt":"2021-03-13T08:00:40Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> From: Taylor Blau <me@ttaylorr.com>\n> Date: Mon, 8 Mar 2021 13:43:47 -0500\n> Subject: [PATCH] Documentation/git-push.txt: correct configuration typo\n>\n> In the EXAMPLES section, git-push(1) says that 'git push origin' pushes\n> the current branch to the value of the 'remote.origin.merge'\n> configuration.\n>\n> This wording (which dates back to b2ed944af7 (push: switch default from\n> \"matching\" to \"simple\", 2013-01-04)) is incorrect. There is no such\n> configuration as 'remote.<name>.merge'. This likely was originally\n> intended to read \"branch.<name>.merge\" instead.\n>\n> Indeed, when 'push.default' is 'simple' (which is the default value, and\n> is applicable in this scenario per \"without additional configuration\"),\n> setup_push_upstream() dies if the branch's local name does not match\n> 'branch.<name>.merge'.\n>\n> Correct this long-standing typo to resolve some recent confusion on the\n> intended behavior of this example.\n>\n> Reported-by: Adam Sharafeddine <adam.shrfdn@gmail.com>\n> Reported-by: Fabien Terrani <terranifabien@gmail.com>\n> Signed-off-by: Taylor Blau <me@ttaylorr.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  Documentation/git-push.txt | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nLooks good.\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\n> diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\n> index ab103c82cf..a953c7c387 100644\n> --- a/Documentation/git-push.txt\n> +++ b/Documentation/git-push.txt\n> @@ -600,7 +600,7 @@ EXAMPLES\n>  \n>  `git push origin`::\n>  \tWithout additional configuration, pushes the current branch to\n> -\tthe configured upstream (`remote.origin.merge` configuration\n> +\tthe configured upstream (`branch.<name>.merge` configuration\n>  \tvariable) if it has the same name as the current branch, and\n>  \terrors out without pushing otherwise.\n\nFrom the discussion it seems this sentence has further room for\nimprovement, but that shouldn't block this straightforward typofix\npatch.\n\nA few ideas for further improvement:\n\n- I think \"the configured upstream\" would read more clearly as \"its\n  configured upstream\"\n\n- the parenthesis could be a little clearer by adding a verb --- e.g.\n  \"as determined by the `branch.<name>.merge` configuration variable\".\n  Alternatively, is that implementation detail the right thing to\n  mention?  Perhaps we could instead say something like \"as configured\n  using git branch --set-upstream-to\" as a way to introduce the\n  concept of a branch's upstream.\n\n- the \"it\" in \"it has the same name\" is vague.  Does a branch's\n  upstream represent the remote-tracking branch (e.g.,\n  refs/remotes/origin/main) it merges or rebases against, or does it\n  represent the remote branch (e.g., refs/heads/main in the remote\n  repository pointed to by origin) it pulls from?\n\nPutting those together, I could imagine something along the lines of\n\n\tWithout additional configuration, this first checks that the\n\tcurrent branch's configured upstream (see git-branch(1)\n\t--set-upstream-to) is a remote branch with the same name and\n\tthen pushes there.  If there is no configured upstream or\n\tthe configured upstream has a different name, it errors out\n\twithout pushing.\n\nThanks,\nJonathan\n"}]}