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

Re: [1.8.0] fix branch.autosetupmerge and branch.autosetuprebase

From
Jay Soffian <jaysoffian@gmail.com>
Date
Mar 2, 2011, 13:37 UTC
Message-ID
<AANLkTimzJreTtZUNO9GKUAEES9cSHDewaedNQHtJvWYn@mail.gmail.com>
In-Reply-To
<1jxhtdj.c6tsy3wnbmbjM%lists@haller-berlin.de>
On Wed, Mar 2, 2011 at 2:30 AM, Stefan Haller <lists@haller-berlin.de> wrote:
Show 21 quoted lines
> Jay Soffian <jaysoffian@gmail.com> wrote:
>
>> 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.
>
> Where I work, none of these is true.  I guess these may be true for an
> open-source kind of setup, where one developer is working on a branch
> and then posts a patch series; however, in a corporate environment with
> a central repository and multiple developers collaborating on a topic
> branch, it's not.  Our workflow is to branch a topic from master (with
> --no-track), push the topic to the central repository
The person who creates topic from master would do the following:
  $ git branch topic origin/master
  $ git push --set-upstream origin topic

Creating topic would initially set its upstream to origin/master. Specifying "--set-upstream" to push would reset topic's upstream from origin/master to origin/topic.

Or they could create the topic remotely this way:
  $ git push origin origin/master:refs/heads/topic
> others pull the topic branch (with autosetuprebase=always)
So they'd do something like this:
  $ git fetch
  $ git checkout -b topic origin/topic

which would make origin/topic the upstream of topic, which I think is exactly what you want.

Show 8 quoted lines
> and contribute to it, and
> eventually it is merged back to master.  We never want automatic
> rebasing onto master for topics.
>
> Which means that we only ever have upstream branches with the same name
> as the local branch.  I haven't seen a single exception yet, and I wish
> there was a way to set autosetupmerge to "only_if_name_matches" or some
> such.
I don't think my proposal makes your workflow more difficult.
Show 6 quoted lines
>> 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.
>
> I like this part of the proposal though.
Thank you for the feedback.
j.
Previous: Stefan HallerNext: Jay Soffian
Message 4 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.