{"thread":{"id":"63834","subject":"[PATCH] doc: clarify difference between `push.default` `simple` and `current`","startedAt":"2025-07-23T23:00:28Z","lastAt":"2025-07-23T23:36:38Z","messageCount":2,"participants":["Dan Fabulich via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"522614","messageId":"pull.1944.git.1753311625075.gitgitgadget@gmail.com","threadId":"63834","inReplyTo":null,"subject":"[PATCH] doc: clarify difference between `push.default` `simple` and `current`","fromName":"Dan Fabulich via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-07-23T23:00:24Z","receivedAt":"2025-07-23T23:00:28Z","isPatch":true,"sender":{"key":"dan@fabulich.com","avatar":"https://gravatar.com/avatar/884cee2af623b7675bebdd7b70b13dcb8423150d8f137ec0841859b80a21cd05?d=mp&s=160"},"body":"From: Dan Fabulich <dan@fabulich.com>\n\nThe documentation made `simple` and `current` sound identical. The\ndifference is that `simple` strictly checks that the upstream tracking\nbranch's name matches the current branch's name.\n\nSigned-off-by: Dan Fabulich <dan@fabulich.com>\n---\n    doc: clarify difference between push.default simple and current\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1944%2Fdfabulich%2Fgit-config-simple-doc-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1944/dfabulich/git-config-simple-doc-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1944\n\n Documentation/config/push.adoc | 16 +++++++++-------\n 1 file changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/config/push.adoc b/Documentation/config/push.adoc\nindex 0acbbea18a3..3e03cb31606 100644\n--- a/Documentation/config/push.adoc\n+++ b/Documentation/config/push.adoc\n@@ -15,7 +15,7 @@ push.default::\n \tDifferent values are well-suited for\n \tspecific workflows; for instance, in a purely central workflow\n \t(i.e. the fetch source is equal to the push destination),\n-\t`upstream` is probably what you want.  Possible values are:\n+\t`simple` is probably what you want.  Possible values are:\n +\n --\n \n@@ -23,8 +23,8 @@ push.default::\n   given. This is primarily meant for people who want to\n   avoid mistakes by always being explicit.\n \n-* `current` - push the current branch to update a branch with the same\n-  name on the receiving end.  Works in both central and non-central\n+* `current` - push the current branch to update the branch with the same\n+  name on the remote.  Works in both central and non-central\n   workflows.\n \n * `upstream` - push the current branch back to the branch whose\n@@ -35,11 +35,13 @@ push.default::\n \n * `tracking` - This is a deprecated synonym for `upstream`.\n \n-* `simple` - push the current branch with the same name on the remote.\n+* `simple` - push the current branch to its upstream tracking branch,\n+  but only if the upstream tracking branch has the same name as the\n+  current branch. (`simple` will fail with an error if the upstream\n+  tracking branch's name doesn't match the current branch's name.)\n +\n-If you are working on a centralized workflow (pushing to the same repository you\n-pull from, which is typically `origin`), then you need to configure an upstream\n-branch with the same name.\n+`simple` will also fail if the current branch doesn't have an upstream\n+tracking branch configured, unless `push.autoSetupRemote` is enabled.\n +\n This mode is the default since Git 2.0, and is the safest option suited for\n beginners.\n\nbase-commit: 3f2a94875d2f41fe4758a439f68d8b73cfb19d0f\n-- \ngitgitgadget\n"},{"id":"522615","messageId":"xmqqseimjx8b.fsf@gitster.g","threadId":"63834","inReplyTo":"pull.1944.git.1753311625075.gitgitgadget@gmail.com","subject":"Re: [PATCH] doc: clarify difference between `push.default` `simple` and `current`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-23T23:36:36Z","receivedAt":"2025-07-23T23:36:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Dan Fabulich via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Dan Fabulich <dan@fabulich.com>\n>\n> The documentation made `simple` and `current` sound identical. The\n> difference is that `simple` strictly checks that the upstream tracking\n> branch's name matches the current branch's name.\n\nAll of the above are correct, and a patch that sticks to fixing that\nwould have given us a great improvement.\n\nThanks for working on this documentation update, but it seems some\nunrelated changes are mixed in.\n\n>  \tDifferent values are well-suited for\n>  \tspecific workflows; for instance, in a purely central workflow\n>  \t(i.e. the fetch source is equal to the push destination),\n> -\t`upstream` is probably what you want.  Possible values are:\n> +\t`simple` is probably what you want.  Possible values are:\n\nThis change is not explained/justified at all why it was part of the\npatch in the proposed log message.\n\nAnd I do not think this is a good change.  `upstream` is recommended\nfor most people when they employ a purely central workflow.  You can\nstart working from the common 'master', even on multiple topics in\nparallel at the same time, and perform \"git push\" with push.default\nset to 'upstream'.  With 'simple' you cannot.\n\n    $ git checkout -t -b theme1 origin/master\n    ... work work work ...\n    $ git checkout -t -b theme2 origin/master\n    ... work work work ...\n    ... changes for theme2 become complete first ...\n    $ git push\n\nHere, if your push.default is set to 'upstream', your theme2 updates\ntheir master, which is exactly what you want.  Then\n\n    $ git fetch origin\n    $ git rebase origin/master theme1\n    ... rebased on updated 'master' at theirs --- at least it should\n    ... contain what we did on our theme2 topic, but possibly\n    ... changes from other people.\n    ... more work ...\n    $ git push\n\nAgain, your theme1 updates their master, which is exactly what you\nwant.\n\n> @@ -23,8 +23,8 @@ push.default::\n>    given. This is primarily meant for people who want to\n>    avoid mistakes by always being explicit.\n>  \n> -* `current` - push the current branch to update a branch with the same\n> -  name on the receiving end.  Works in both central and non-central\n> +* `current` - push the current branch to update the branch with the same\n> +  name on the remote.  Works in both central and non-central\n>    workflows.\n\nAgain, a change that is not explained/justified.  \"a\" -> \"the\" I can\nunderstand (i.e. a branch with the same name is unique over there,\nso \"the\" is more appropriate), but not the other one.\n\n>  * `tracking` - This is a deprecated synonym for `upstream`.\n>  \n> -* `simple` - push the current branch with the same name on the remote.\n> +* `simple` - push the current branch to its upstream tracking branch,\n> +  but only if the upstream tracking branch has the same name as the\n> +  current branch. (`simple` will fail with an error if the upstream\n> +  tracking branch's name doesn't match the current branch's name.)\n\nThat is correct.  The additional text may be somewhat helpful for\nsomebody who just got an error message and wants to understand where\nthe error comes from.\n\nBut stepping back a bit, is understanding why it failed the primary\nthing our documentation should aim for?  I'd rather see our\ndocumentation help the user achieve what they wanted to do in the\nfirst place.  I.e., Be able to push without an error to publish\ntheir work.  And for that \"this will fail when X\" is less helpful\nthan \"this is appropriate if you work this way.\"\n\n    simple - this is like `upstream` but with additional restriction\n    that the local branch must be named the same as its upstream\n    branch.  Suitable with a very simple centralized workflow, where\n    you fork off of their 'master' branch to create your own\n    'master', work there, and push the branch back.\n\n>  +\n> -If you are working on a centralized workflow (pushing to the same repository you\n> -pull from, which is typically `origin`), then you need to configure an upstream\n> -branch with the same name.\n\nI do not think this removal is explained/justified, either.  Those\nwho set push.default to 'simple' while using the centralized\nworkflow must use one-to-one correspondence, so this advice is very\nrelevant.  What makes it a good idea to remove it?\n\nThanks.\n"}]}