git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] merge: new autosetupmerge option 'simple' for matching branches

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2022, 01:53 UTC
Message-ID
<xmqqlevzkxrf.fsf@gitster.g>
In-Reply-To
<CAPMMpohQei9vBBm=7hC=N5LPwzMCED=fZcXyePnrkLCHfCJTZw@mail.gmail.com>
Tao Klerks <tao@klerks.biz> writes:
Show 16 quoted lines
> If they branched from a different-name remote branch (they created an
> new / independent local branch), then no remote tracking relationship
> will have been set up, and instead of the "fatal: The upstream branch
> of your current branch does not match
> the name of your current branch" error and advice, they will get a
> much simpler error and advice:
>
> ---
> fatal: The current branch whatevs has no upstream branch.
> To push the current branch and set the remote as upstream, use
>
>     git push --set-upstream origin whatevs
> ---
>
> When they follow those instructions, they will be in the "simple"
> setup same as if they had just branched from same-name.

Which means that they need to see an error once, offered to either set push.default or branch.autosetupmerge (it is not "and/or", but "or", because you want to tell them to set "instead of push.default, set branch.autosetupmerge"), and if they follow the latter, they have to then hit a different error and be told to do the "set-upstream" individually. I am wondering if that is more irritating than it is worth. Instead, if you tell them to use branch.autosetupmerge=simple and use push.default to something better than simple, wouldn't that cover more cases and give fewer roadblocks to the end-user with unnecessary errors?

Show 6 quoted lines
>> Setting the latter to 'simple'
>> means there are *MORE* branches that do not have .remote/.merge set
>> up, doesn't it?  Which in turn means that we are relying more on
>> what push.default is set to, right?
>
> No

Why no? if setupauto is yes, then any new branch forked from a remote-tracking branch will get .remote/.merge set up, and with these specific configuration they can "push" back to the configured place. If it is set to simple, only new branches forked from a remote-tracking branch that happens to have the same name will get it, and others do not get .remote/.merge set up. Which means user's "git push" will then consult push.default settings, and setting it right becomes more important, no?

Previous: Tao KlerksNext: Tao Klerks
Message 28 of 41 in “adding new branch.autosetupmerge option "simple"”
  1. 0/3 adding new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 24, 2022
  2. 1/3 merge: new autosetupmerge option 'simple' for matching branchesTao Klerks via GitGitGadget, Feb 24, 2022
  3. Junio C HamanoFeb 24, 2022
  4. 2/3 t3200: tests for new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 24, 2022
  5. 3/3 branch documentation: new autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 24, 2022
  6. Junio C HamanoFeb 24, 2022
  7. 0/2 adding new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 25, 2022
  8. 1/2 merge: new autosetupmerge option 'simple' for matching branchesTao Klerks via GitGitGadget, Feb 25, 2022
  9. Junio C HamanoFeb 25, 2022
  10. Tao KlerksFeb 27, 2022
  11. 2/2 t3200: tests for new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 25, 2022
  12. 0/2 adding new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 28, 2022
  13. 2/2 t3200: tests for new branch.autosetupmerge option "simple"Tao Klerks via GitGitGadget, Feb 28, 2022
  14. Ævar Arnfjörð BjarmasonFeb 28, 2022
  15. Eric SunshineMar 1, 2022
  16. Tao KlerksMar 1, 2022
  17. Tao KlerksMar 1, 2022
  18. 1/2 merge: new autosetupmerge option 'simple' for matching branchesTao Klerks via GitGitGadget, Feb 28, 2022
  19. Ævar Arnfjörð BjarmasonFeb 28, 2022
  20. Tao KlerksMar 2, 2022
  21. Tao KlerksMar 20, 2022
  22. merge: new autosetupmerge option 'simple' for matching branchesTao Klerks via GitGitGadget, Mar 21, 2022
  23. Josh SteadmonApr 18, 2022
  24. Tao KlerksApr 20, 2022
  25. Josh SteadmonApr 20, 2022
  26. Junio C HamanoApr 20, 2022
  27. Tao KlerksApr 20, 2022
  28. Junio C HamanoApr 21, 2022
  29. Tao KlerksApr 21, 2022
  30. Junio C HamanoApr 22, 2022
  31. Tao KlerksApr 22, 2022
  32. Tao KlerksApr 22, 2022
  33. Junio C HamanoApr 23, 2022
  34. Tao KlerksApr 24, 2022
  35. Tao KlerksApr 29, 2022
  36. 0/3 New options to support "simple" centralized workflowTao Klerks via GitGitGadget, Apr 29, 2022
  37. 1/3 branch: new autosetupmerge option 'simple' for matching branchesTao Klerks via GitGitGadget, Apr 29, 2022
  38. 2/3 push: default to single remote even when not named originTao Klerks via GitGitGadget, Apr 29, 2022
  39. 3/3 push: new config option "push.autoSetupRemote" supports "simple" pushTao Klerks via GitGitGadget, Apr 29, 2022
  40. Junio C HamanoApr 29, 2022
  41. Tao KlerksApr 30, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.