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

[1.8.0] fix branch.autosetupmerge and branch.autosetuprebase

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 28, 2011, 22:37 UTC
Message-ID
<AANLkTi=Ei-Gr3=O0_dfaCekQ0+nB8v1kZYT7sTw-Ydm+@mail.gmail.com>

It strikes me that branch.autosetupmerge and branch.autosetuprebase are a bit crufty. So a proposal:

Proposal ========

1. Deprecate branch.autosetupmerge. Right now it's got three choices:
false, true, and always, defaulting to "true"

But I wonder, does anyone use "false" and not set the upstream? And I think that "always" is a misfeature (I'm qualified to say this, see 9ed36cf). 99% of the time, I think you are doing one of the following:

  $ git branch topic origin/master    # 1
  $ git branch topic master           # 2
  $ git branch topic some_other_topic # 3

In the case of (1), you want origin/master to be configured as the upstream for topic. In the case of (2), even though you are starting at master, I'll bet you want the upstream to be origin/master. In the case of (3), even though you are starting at some_other_topic, I'll bet you want topic to have the same configured upstream as some_other_topic.

So, my proposal wrt to branch.autosetupmerge is that we deprecate it and always do the following:

- When creating a local branch L from remote-tracking branch R, set R
as upstream of L.
- When creating a local branch L1 from other local branch L2, whose
upstream is remote-tracking branch R, set R as upstream of L1.

For the 1% of the time that you really want local branch L2 to be upstream of L1, specify that explicitly when you create the branch.

2. Deprecate branch.autosetuprebase. Pull's default action shouldn't
be specified when the branch is created. Rather, add a "pull.rebase"
boolean defaulting to false, and which is overridden per-branch by
branch.<name>.rebase.

Migration =========

Let's first see if the proposal flies because it's good, or whether it has flies because it stinks. :-)

j.
Next: Miles Bader
Message 1 of 5 in “[1.8.0] fix branch.autosetupmerge and branch.autosetuprebase”
  1. Jay SoffianFeb 28, 2011
  2. Miles BaderMar 1, 2011
  3. Stefan HallerMar 2, 2011
  4. Jay SoffianMar 2, 2011
  5. Jay SoffianFeb 28, 2011

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.