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

Re: [PATCH 1/1] config: support a default remote tracking setup upon branch creation

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 2, 2021, 13:02 UTC
Message-ID
<87sfzsngad.fsf@evledraar.gmail.com>
In-Reply-To
<20210729020125.746206-2-mathstuf@gmail.com>
On Wed, Jul 28 2021, Ben Boeckel wrote:
Show 11 quoted lines
> The `branch.autoSetupMerge` works well today for setting up tracking a
> local branch, but there is no easy mechanism to automatically set up a
> remote tracking situation for workflows which use a single set of
> branches for integration without specifying `--track` to every branch
> creation command or branching directly from the remote ref. This patch
> adds the following configuration values:
>
>   - `branch.defaultRemote`: initializes `branch.<name>.remote` if not
>     otherwise given;
>   - `branch.defaultMerge`: initializes `branch.<name>.merge` if not
>     otherwise given.

Not a new issue per-se, but what if you've got a branch called defaultRemote? It seems to me that any new branch.<name>.* config closes the door for a <name> we squat on.

Given that we have checkout.defaultRemote and this also affects switch/checkout it seems better to continue in the checkout.* namespace even if it wasn't for that, but given the config squatting issue especially so....

For what it's worth I usually use the checkout.defaultRemote option (which I added) and:

    git checkout master &&
    git branch -m master <topic-name>

See 8d7b558baeb (checkout & worktree: introduce checkout.defaultRemote, 2018-06-05). It seems to me from that patch diff that you could modify some docs / tests for this, no? E.g. how it interacts with git-worktree.

I like this direction, but just have a concern that this is a place where we need to consider all the UX in the area overall, and that any options/config don't overtly interact in a bad way.

Previous: Junio C HamanoNext: Ben Boeckel
Message 11 of 20 in “Improve automatic setup of tracking for new branches”
  1. 0/1 Improve automatic setup of tracking for new branchesBen Boeckel, Jul 28, 2021
  2. 1/1 config: support setting up a remote tracking branch upon creationBen Boeckel, Jul 28, 2021
  3. Junio C HamanoJul 28, 2021
  4. Ben BoeckelJul 28, 2021
  5. Junio C HamanoJul 28, 2021
  6. 0/1 Improve automatic setup of tracking for new branchesBen Boeckel, Jul 29, 2021
  7. 1/1 config: support a default remote tracking setup upon branch creationBen Boeckel, Jul 29, 2021
  8. Philippe BlainJul 30, 2021
  9. Ben BoeckelJul 30, 2021
  10. Junio C HamanoJul 30, 2021
  11. Ævar Arnfjörð BjarmasonAug 2, 2021
  12. Ben BoeckelAug 2, 2021
  13. Ævar Arnfjörð BjarmasonAug 2, 2021
  14. Junio C HamanoJul 30, 2021
  15. Ben BoeckelJul 30, 2021
  16. Philippe BlainJul 30, 2021
  17. Ben BoeckelJul 30, 2021
  18. Philippe BlainJul 30, 2021
  19. Ben BoeckelJul 30, 2021
  20. Johannes SchindelinAug 2, 2021

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.