{"thread":{"id":"26625","subject":"[1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","startedAt":"2011-02-28T22:37:49Z","lastAt":"2011-03-02T13:37:59Z","messageCount":5,"participants":["Jay Soffian","Miles Bader","Stefan Haller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162486","messageId":"AANLkTi=Ei-Gr3=O0_dfaCekQ0+nB8v1kZYT7sTw-Ydm+@mail.gmail.com","threadId":"26625","inReplyTo":null,"subject":"[1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-02-28T22:37:49Z","receivedAt":"2011-02-28T22:37:49Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"It strikes me that branch.autosetupmerge and branch.autosetuprebase\nare a bit crufty. So a proposal:\n\nProposal\n========\n\n1. Deprecate branch.autosetupmerge. Right now it's got three choices:\nfalse, true, and always, defaulting to \"true\"\n\nBut I wonder, does anyone use \"false\" and not set the upstream? And I\nthink that \"always\" is a misfeature (I'm qualified to say this, see\n9ed36cf). 99% of the time, I think you are doing one of the following:\n\n  $ git branch topic origin/master    # 1\n  $ git branch topic master           # 2\n  $ git branch topic some_other_topic # 3\n\nIn the case of (1), you want origin/master to be configured as the\nupstream for topic. In the case of (2), even though you are starting\nat master, I'll bet you want the upstream to be origin/master. In the\ncase of (3), even though you are starting at some_other_topic, I'll\nbet you want topic to have the same configured upstream as\nsome_other_topic.\n\nSo, my proposal wrt to branch.autosetupmerge is that we deprecate it\nand always do the following:\n\n- When creating a local branch L from remote-tracking branch R, set R\nas upstream of L.\n- When creating a local branch L1 from other local branch L2, whose\nupstream is remote-tracking branch R, set R as upstream of L1.\n\nFor the 1% of the time that you really want local branch L2 to be\nupstream of L1, specify that explicitly when you create the branch.\n\n2. Deprecate branch.autosetuprebase. Pull's default action shouldn't\nbe specified when the branch is created. Rather, add a \"pull.rebase\"\nboolean defaulting to false, and which is overridden per-branch by\nbranch.<name>.rebase.\n\nMigration\n=========\n\nLet's first see if the proposal flies because it's good, or whether it\nhas flies because it stinks. :-)\n\nj.\n"},{"id":"162495","messageId":"AANLkTi=nhc=a6wW9BPiDy_2rbZQCVmhZ75u7MuF33w06@mail.gmail.com","threadId":"26625","inReplyTo":"A8063D85-43A0-474A-8467-DE8473F52ECB@spy.net","subject":"Re: [1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-02-28T23:43:52Z","receivedAt":"2011-02-28T23:43:52Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Mon, Feb 28, 2011 at 6:03 PM, Dustin Sallings <dustin@spy.net> wrote:\n>\n> On Feb 28, 2011, at 14:37, Jay Soffian wrote:\n>\n> 2. Deprecate branch.autosetuprebase. Pull's default action shouldn't\n> be specified when the branch is created. Rather, add a \"pull.rebase\"\n> boolean defaulting to false, and which is overridden per-branch by\n> branch.<name>.rebase.\n>\n> Do you mean to say ``pull.rebase'' configured to true would do the same\n> thing?\n\nEffectively, yes. If a user specifies \"pull.rebase true\" in their\n.gitconfig or repo .git/config, then when they \"git pull\" while on\nbranch <name>, pull will rebase, unless branch.<name>.rebase exists\nand is set to false.\n\nany branches that don't have an explicit \"branch.<name>.rebase = false\" will\n\n> If so, I'm fine with killing off branch.autosetuprebase.  The goal is to\n> have something I can easily give to other people so that we all work the\n> same way.\n\nUnderstood. I recently have the same goal, but my users have\npre-existing branches that they setup before I told them to \"git\nconfig branch.autosetuprebase true\". Now they need to go configure\nevery one of those branches to rebase by default.\n\nIt would be nice if I could just tell them \"git config --global\npull.rebase true\" and have it affect all their repos and branches. :-)\n\nj.\n"},{"id":"162507","messageId":"871v2rd3fm.fsf@catnip.gol.com","threadId":"26625","inReplyTo":"AANLkTi=Ei-Gr3=O0_dfaCekQ0+nB8v1kZYT7sTw-Ydm+@mail.gmail.com","subject":"Re: [1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2011-03-01T01:39:41Z","receivedAt":"2011-03-01T01:39:41Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n> So, my proposal wrt to branch.autosetupmerge is that we deprecate it\n> and always do the following:\n>\n> - When creating a local branch L from remote-tracking branch R, set R\n> as upstream of L.\n> - When creating a local branch L1 from other local branch L2, whose\n> upstream is remote-tracking branch R, set R as upstream of L1.\n\nThat would certainly match my usage better...\n\n-miles\n\n-- \nEverywhere is walking distance if you have the time.  -- Steven Wright\n"},{"id":"162626","messageId":"1jxhtdj.c6tsy3wnbmbjM%lists@haller-berlin.de","threadId":"26625","inReplyTo":"AANLkTi=Ei-Gr3=O0_dfaCekQ0+nB8v1kZYT7sTw-Ydm+@mail.gmail.com","subject":"Re: [1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","fromName":"Stefan Haller","fromEmail":"lists@haller-berlin.de","sentAt":"2011-03-02T07:30:00Z","receivedAt":"2011-03-02T07:30:00Z","isPatch":false,"sender":{"key":"lists@haller-berlin.de","avatar":null},"body":"Jay Soffian <jaysoffian@gmail.com> wrote:\n\n> 99% of the time, I think you are doing one of the following:\n> \n>   $ git branch topic origin/master    # 1\n>   $ git branch topic master           # 2\n>   $ git branch topic some_other_topic # 3\n> \n> In the case of (1), you want origin/master to be configured as the\n> upstream for topic. In the case of (2), even though you are starting\n> at master, I'll bet you want the upstream to be origin/master. In the\n> case of (3), even though you are starting at some_other_topic, I'll\n> bet you want topic to have the same configured upstream as\n> some_other_topic.\n\nWhere I work, none of these is true.  I guess these may be true for an\nopen-source kind of setup, where one developer is working on a branch\nand then posts a patch series; however, in a corporate environment with\na central repository and multiple developers collaborating on a topic\nbranch, it's not.  Our workflow is to branch a topic from master (with\n--no-track), push the topic to the central repository, others pull the\ntopic branch (with autosetuprebase=always) and contribute to it, and\neventually it is merged back to master.  We never want automatic\nrebasing onto master for topics.\n\nWhich means that we only ever have upstream branches with the same name\nas the local branch.  I haven't seen a single exception yet, and I wish\nthere was a way to set autosetupmerge to \"only_if_name_matches\" or some\nsuch.\n\n> 2. Deprecate branch.autosetuprebase. Pull's default action shouldn't\n> be specified when the branch is created. Rather, add a \"pull.rebase\"\n> boolean defaulting to false, and which is overridden per-branch by\n> branch.<name>.rebase.\n\nI like this part of the proposal though.\n\n\n-- \nStefan Haller\nBerlin, Germany\nhttp://www.haller-berlin.de/\n"},{"id":"162639","messageId":"AANLkTimzJreTtZUNO9GKUAEES9cSHDewaedNQHtJvWYn@mail.gmail.com","threadId":"26625","inReplyTo":"1jxhtdj.c6tsy3wnbmbjM%lists@haller-berlin.de","subject":"Re: [1.8.0] fix branch.autosetupmerge and branch.autosetuprebase","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2011-03-02T13:37:59Z","receivedAt":"2011-03-02T13:37:59Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Mar 2, 2011 at 2:30 AM, Stefan Haller <lists@haller-berlin.de> wrote:\n> Jay Soffian <jaysoffian@gmail.com> wrote:\n>\n>> 99% of the time, I think you are doing one of the following:\n>>\n>>   $ git branch topic origin/master    # 1\n>>   $ git branch topic master           # 2\n>>   $ git branch topic some_other_topic # 3\n>>\n>> In the case of (1), you want origin/master to be configured as the\n>> upstream for topic. In the case of (2), even though you are starting\n>> at master, I'll bet you want the upstream to be origin/master. In the\n>> case of (3), even though you are starting at some_other_topic, I'll\n>> bet you want topic to have the same configured upstream as\n>> some_other_topic.\n>\n> Where I work, none of these is true.  I guess these may be true for an\n> open-source kind of setup, where one developer is working on a branch\n> and then posts a patch series; however, in a corporate environment with\n> a central repository and multiple developers collaborating on a topic\n> branch, it's not.  Our workflow is to branch a topic from master (with\n> --no-track), push the topic to the central repository\n\nThe person who creates topic from master would do the following:\n\n  $ git branch topic origin/master\n  $ git push --set-upstream origin topic\n\nCreating topic would initially set its upstream to origin/master.\nSpecifying \"--set-upstream\" to push would reset topic's upstream from\norigin/master to origin/topic.\n\nOr they could create the topic remotely this way:\n\n  $ git push origin origin/master:refs/heads/topic\n\n> others pull the topic branch (with autosetuprebase=always)\n\nSo they'd do something like this:\n\n  $ git fetch\n  $ git checkout -b topic origin/topic\n\nwhich would make origin/topic the upstream of topic, which I think is\nexactly what you want.\n\n> and contribute to it, and\n> eventually it is merged back to master.  We never want automatic\n> rebasing onto master for topics.\n>\n> Which means that we only ever have upstream branches with the same name\n> as the local branch.  I haven't seen a single exception yet, and I wish\n> there was a way to set autosetupmerge to \"only_if_name_matches\" or some\n> such.\n\nI don't think my proposal makes your workflow more difficult.\n\n>> 2. Deprecate branch.autosetuprebase. Pull's default action shouldn't\n>> be specified when the branch is created. Rather, add a \"pull.rebase\"\n>> boolean defaulting to false, and which is overridden per-branch by\n>> branch.<name>.rebase.\n>\n> I like this part of the proposal though.\n\nThank you for the feedback.\n\nj.\n"}]}