Andreas Schwab [off-list ref] writes:
On Mär 08 2021, Taylor Blau wrote:
quoted
On Mon, Mar 08, 2021 at 09:57:56PM +0100, Andreas Schwab wrote:
quoted
The configured upstream is the value of branch.<name>.merge, isn't it?
That would be the name of a remote, not the name of a branch.
Right; the '<name>' in 'branch.<name>.merge' is your local name for a
branch, but the value of that configuration is the remote's name.
Sorry, I was misreading branch.<name>.merge as branch.<name>.remote.
Now it makes all sense to me.
OK, so do we have a version that is good to go?
Thanks.
-- >8 --
From: Taylor Blau <redacted>
Date: Mon, 8 Mar 2021 13:43:47 -0500
Subject: [PATCH] Documentation/git-push.txt: correct configuration typo
In the EXAMPLES section, git-push(1) says that 'git push origin' pushes
the current branch to the value of the 'remote.origin.merge'
configuration.
This wording (which dates back to b2ed944af7 (push: switch default from
"matching" to "simple", 2013-01-04)) is incorrect. There is no such
configuration as 'remote.<name>.merge'. This likely was originally
intended to read "branch.<name>.merge" instead.
Indeed, when 'push.default' is 'simple' (which is the default value, and
is applicable in this scenario per "without additional configuration"),
setup_push_upstream() dies if the branch's local name does not match
'branch.<name>.merge'.
Correct this long-standing typo to resolve some recent confusion on the
intended behavior of this example.
Reported-by: Adam Sharafeddine <redacted>
Reported-by: Fabien Terrani <redacted>
Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
Notes (amlog):
Message-Id: [off-list ref]
Documentation/git-push.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index ab103c82cf..a953c7c387 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -600,7 +600,7 @@ EXAMPLES
`git push origin`::
Without additional configuration, pushes the current branch to
- the configured upstream (`remote.origin.merge` configuration
+ the configured upstream (`branch.<name>.merge` configuration
variable) if it has the same name as the current branch, and
errors out without pushing otherwise.
+
--
2.31.0-rc2-171-g89112de4ba
Junio C Hamano wrote:
From: Taylor Blau <redacted>
Date: Mon, 8 Mar 2021 13:43:47 -0500
Subject: [PATCH] Documentation/git-push.txt: correct configuration typo
In the EXAMPLES section, git-push(1) says that 'git push origin' pushes
the current branch to the value of the 'remote.origin.merge'
configuration.
This wording (which dates back to b2ed944af7 (push: switch default from
"matching" to "simple", 2013-01-04)) is incorrect. There is no such
configuration as 'remote.<name>.merge'. This likely was originally
intended to read "branch.<name>.merge" instead.
Indeed, when 'push.default' is 'simple' (which is the default value, and
is applicable in this scenario per "without additional configuration"),
setup_push_upstream() dies if the branch's local name does not match
'branch.<name>.merge'.
Correct this long-standing typo to resolve some recent confusion on the
intended behavior of this example.
Reported-by: Adam Sharafeddine <redacted>
Reported-by: Fabien Terrani <redacted>
Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
Documentation/git-push.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Looks good.
Reviewed-by: Jonathan Nieder <redacted>
quoted hunk
diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt
index ab103c82cf..a953c7c387 100644
--- a/Documentation/git-push.txt
+++ b/Documentation/git-push.txt
@@ -600,7 +600,7 @@ EXAMPLES
`git push origin`::
Without additional configuration, pushes the current branch to
- the configured upstream (`remote.origin.merge` configuration
+ the configured upstream (`branch.<name>.merge` configuration
variable) if it has the same name as the current branch, and
errors out without pushing otherwise.
From the discussion it seems this sentence has further room for
improvement, but that shouldn't block this straightforward typofix
patch.
A few ideas for further improvement:
- I think "the configured upstream" would read more clearly as "its
configured upstream"
- the parenthesis could be a little clearer by adding a verb --- e.g.
"as determined by the `branch.<name>.merge` configuration variable".
Alternatively, is that implementation detail the right thing to
mention? Perhaps we could instead say something like "as configured
using git branch --set-upstream-to" as a way to introduce the
concept of a branch's upstream.
- the "it" in "it has the same name" is vague. Does a branch's
upstream represent the remote-tracking branch (e.g.,
refs/remotes/origin/main) it merges or rebases against, or does it
represent the remote branch (e.g., refs/heads/main in the remote
repository pointed to by origin) it pulls from?
Putting those together, I could imagine something along the lines of
Without additional configuration, this first checks that the
current branch's configured upstream (see git-branch(1)
--set-upstream-to) is a remote branch with the same name and
then pushes there. If there is no configured upstream or
the configured upstream has a different name, it errors out
without pushing.
Thanks,
Jonathan