{"thread":{"id":"43113","subject":"Re: git pull and merging.","startedAt":"2006-12-06T04:51:46Z","lastAt":"2006-12-09T16:14:12Z","messageCount":36,"participants":["Josef Weidendorfer","Santi Béjar","Aneesh Kumar K.V","Junio C Hamano","Johannes Schindelin","Peter Baumann","Jakub Narebski","Aneesh Kumar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"297166","messageId":"cc723f590612052051r62111c4cgfd7ee893cb00f84a@mail.gmail.com","threadId":"43113","inReplyTo":null,"subject":"git pull and merging.","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-12-06T04:51:46Z","receivedAt":"2006-12-06T04:51:46Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"I have a git.git clone using --use-separate-remote. That means i have\nthe master branch created by default. Now i need to build git from the\npu branch too. So i created git branch pu remotes/origin/pu.\n\n\nHow how do i track the pu branch using git pull. What i mean is the\nmaster local branch is tracked by default using git pull. Is there a\nway to track the local pu branch too.\n\nI looked at git-repo-config and branch.<name>. config variable usage\nis confusing. After initial try i concluded that it is to replace\n.git/remotes/origin not the requirement i had.\n\n"},{"id":"294093","messageId":"7vodqhaa7o.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"cc723f590612052051r62111c4cgfd7ee893cb00f84a@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-06T05:02:03Z","receivedAt":"2006-12-06T05:02:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar\" <aneesh.kumar@gmail.com> writes:\n\n> I have a git.git clone using --use-separate-remote. That means i have\n> the master branch created by default. Now i need to build git from the\n> pu branch too. So i created git branch pu remotes/origin/pu.\n>\n>\n> How how do i track the pu branch using git pull. What i mean is the\n> master local branch is tracked by default using git pull. Is there a\n> way to track the local pu branch too.\n\n        $ cat >.git/remotes/origin <<\\EOF\n        URL: ...kernel.org/pub/scm/git/git.git\n        Pull: refs/heads/master:refs/remotes/origin/master\n        Pull: refs/heads/next:refs/remotes/origin/next\n        Pull: +refs/heads/pu:refs/remotes/origin/pu\n        EOF\n\nThen you would checkout 'pu' by having a matching local branch:\n\n\t$ git branch pu remotes/origin/pu\n\t$ git checkout pu ;# this is your refs/heads/pu\n        $ make\n\nHacking on it can be done in this branch as usual.  When you are\ninterested in the latest 'pu' from me:\n\n\t$ git checkout pu ;# this is your refs/heads/pu\n\t$ git fetch ;# most of the time git pull would also be fine...\n\nand then:\n\n\t$ git rebase remotes/origin/pu\n\nThe 'rebase' in the last step is because my 'pu' rewinds freely;\notherwise you would do \"git merge remotes/origin/pu\" instead.\n"},{"id":"295592","messageId":"cc723f590612052121u1f6e3c9lc7329f40ee1c9e5a@mail.gmail.com","threadId":"43113","inReplyTo":"7vodqhaa7o.fsf@assigned-by-dhcp.cox.net","subject":"Re: git pull and merging.","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-12-06T05:21:18Z","receivedAt":"2006-12-06T05:21:18Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"On 12/6/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Aneesh Kumar\" <aneesh.kumar@gmail.com> writes:\n>\n> > I have a git.git clone using --use-separate-remote. That means i have\n> > the master branch created by default. Now i need to build git from the\n> > pu branch too. So i created git branch pu remotes/origin/pu.\n> >\n> >\n> > How how do i track the pu branch using git pull. What i mean is the\n> > master local branch is tracked by default using git pull. Is there a\n> > way to track the local pu branch too.\n>\n>         $ cat >.git/remotes/origin <<\\EOF\n>         URL: ...kernel.org/pub/scm/git/git.git\n>         Pull: refs/heads/master:refs/remotes/origin/master\n>         Pull: refs/heads/next:refs/remotes/origin/next\n>         Pull: +refs/heads/pu:refs/remotes/origin/pu\n>         EOF\n>\n> Then you would checkout 'pu' by having a matching local branch:\n>\n>         $ git branch pu remotes/origin/pu\n>         $ git checkout pu ;# this is your refs/heads/pu\n>         $ make\n>\n> Hacking on it can be done in this branch as usual.  When you are\n> interested in the latest 'pu' from me:\n>\n>         $ git checkout pu ;# this is your refs/heads/pu\n>         $ git fetch ;# most of the time git pull would also be fine...\n>\n> and then:\n>\n>         $ git rebase remotes/origin/pu\n>\n> The 'rebase' in the last step is because my 'pu' rewinds freely;\n> otherwise you would do \"git merge remotes/origin/pu\" instead.\n>\n\n\nOkey what i was looking for was a .git/config that will imply as a\npart of git pull origin that local\n\nmaster is to track remotes/origin/master\npu  should track remotes/origin/pu.\n\nI almost felt the branch.<name>.merge was for that.\n\nWhat is this git-repo-config used for. I am trying to understand\n\n\nbranch.<name>.remote and branch.<name>.merge usage.\n\n"},{"id":"298239","messageId":"Pine.LNX.4.63.0612061019350.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43113","inReplyTo":"cc723f590612052121u1f6e3c9lc7329f40ee1c9e5a@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T09:26:37Z","receivedAt":"2006-12-06T09:26:37Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Aneesh Kumar wrote:\n\n> On 12/6/06, Junio C Hamano <junkio@cox.net> wrote:\n> \n> >         $ cat >.git/remotes/origin <<\\EOF\n> >         URL: ...kernel.org/pub/scm/git/git.git\n> >         Pull: refs/heads/master:refs/remotes/origin/master\n> >         Pull: refs/heads/next:refs/remotes/origin/next\n> >         Pull: +refs/heads/pu:refs/remotes/origin/pu\n> >         EOF\n> \n> Okey what i was looking for was a .git/config that will imply as a\n> part of git pull origin that local\n> \n> master is to track remotes/origin/master\n> pu  should track remotes/origin/pu.\n\nYou can have the same effect as what Junio wrote with the config:\n\n$ git repo-config remote.origin.url git://git.kernel.org/pub/scm/git/git.git\n$ git repo-config remote.origin.fetch \\\n\trefs/heads/master:refs/remotes/origin/master\n$ git repo-config remote.origin.fetch \\\n\trefs/heads/next:refs/remotes/origin/next ^$\n$ git repo-config remote.origin.fetch \\\n\t+refs/heads/pu:refs/remotes/origin/pu ^$\n\nBut if you clone with recent git, that will already be set up for you \n(well, except that the \"+\" is missing in front of the \"pu\" thing, which \nsays that it is okay if that particular ref is not fast-forwarding).\n\n> I almost felt the branch.<name>.merge was for that.\n\nNo. This tells git which _default_ branch to merge with. I.e.\n\n$ git repo-config branch.master.remote origin\n$ git repo-config branch.master.merge next\n\nmeans that if your current branch is \"master\", a \"git pull\" _without_ \nparameters will default to the branch \"next\" of the remote \"origin\" you \njust set up like above.\n\nHth,\nDscho\n"},{"id":"297248","messageId":"el62hi$esu$1@sea.gmane.org","threadId":"43113","inReplyTo":"cc723f590612052121u1f6e3c9lc7329f40ee1c9e5a@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T09:31:29Z","receivedAt":"2006-12-06T09:31:29Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Aneesh Kumar wrote:\n\n> On 12/6/06, Junio C Hamano <junkio@cox.net> wrote:\n>> \"Aneesh Kumar\" <aneesh.kumar@gmail.com> writes:\n>>\n>>> I have a git.git clone using --use-separate-remote. That means i have\n>>> the master branch created by default. Now i need to build git from the\n>>> pu branch too. So i created git branch pu remotes/origin/pu.\n>>>\n>>>\n>>> How how do i track the pu branch using git pull. What i mean is the\n>>> master local branch is tracked by default using git pull. Is there a\n>>> way to track the local pu branch too.\n>>\n>>         $ cat>.git/remotes/origin <<\\EOF\n>>         URL: ...kernel.org/pub/scm/git/git.git\n>>         Pull: refs/heads/master:refs/remotes/origin/master\n>>         Pull: refs/heads/next:refs/remotes/origin/next\n>>         Pull: +refs/heads/pu:refs/remotes/origin/pu\n>>         EOF\n\nOr you can do .git/config equivalent:\n\n$ git repo-config remote.origin.url ...kernel.org/pub/scm/git/git.git\n$ git repo-config remote.origin.fetch  refs/heads/master:refs/remotes/origin/master\n$ git repo-config remote.origin.fetch  refs/heads/next:refs/remotes/origin/next\n$ git repo-config remote.origin.fetch +refs/heads/pu:refs/remotes/origin/pu\n\n>> Then you would checkout 'pu' by having a matching local branch:\n>>\n>>         $ git branch pu remotes/origin/pu\n>>         $ git checkout pu ;# this is your refs/heads/pu\n>>         $ make\n>>\n>> Hacking on it can be done in this branch as usual.  When you are\n>> interested in the latest 'pu' from me:\n>>\n>>         $ git checkout pu ;# this is your refs/heads/pu\n>>         $ git fetch ;# most of the time git pull would also be fine...\n>>\n>> and then:\n>>\n>>         $ git rebase remotes/origin/pu\n>>\n>> The 'rebase' in the last step is because my 'pu' rewinds freely;\n>> otherwise you would do \"git merge remotes/origin/pu\" instead.\n>>\n> \n> Okey what i was looking for was a .git/config that will imply as a\n> part of git pull origin that local\n> \n> master is to track remotes/origin/master\n> pu  should track remotes/origin/pu.\n> \n> I almost felt the branch.<name>.merge was for that.\n> \n> What is this git-repo-config used for. I am trying to understand\n> \n> branch.<name>.remote and branch.<name>.merge usage.\n\nYes it is what branch.<name>.merge is for... and it would work for\nany branch _except_ pu, which rewinds frequently, and you should\nrebase your changes on top of current version instead of merging.\n\nStill it is useful to add branch.<branch>.remote for pu:\n\n  $ git repo-config branch.refs/heads/pu.remote origin\n\nso you can do just \"git fetch\" on pu to fetch from origin (well,\n\"git fetch\" would fetch from origin as it is the default even in\nabsence of branch.<branch>.remote).\n\nIf it were any other branch, for example next, you could add\n\n  $ git repo-config branch.refs/heads/next.remote origin\n  $ git repo-config branch.refs/heads/next.merge refs/remotes/origin/next\n\nfor \"git pull\" on next branch fo fetch from origin and merge\nnext branch from origin. \n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297123","messageId":"Pine.LNX.4.63.0612061057250.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43113","inReplyTo":"el62hi$esu$1@sea.gmane.org","subject":"Re: git pull and merging.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T09:58:31Z","receivedAt":"2006-12-06T09:58:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Jakub Narebski wrote:\n\n> $ git repo-config remote.origin.fetch  refs/heads/master:refs/remotes/origin/master\n> $ git repo-config remote.origin.fetch  refs/heads/next:refs/remotes/origin/next\n\nOops. You want to append \"^$\" at the end (otherwise the \"master\" entry is \noverwritten; remote.origin.fetch is a multivalued key). Same for \"pu\".\n\nCiao,\n"},{"id":"296984","messageId":"slrnend551.arq.Peter.B.Baumann@xp.machine.xx","threadId":"43113","inReplyTo":"Pine.LNX.4.63.0612061019350.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git pull and merging.","fromName":"Peter Baumann","fromEmail":"peter.b.baumann@stud.informatik.uni-erlangen.de","sentAt":"2006-12-06T10:00:01Z","receivedAt":"2006-12-06T10:00:01Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On 2006-12-06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> You can have the same effect as what Junio wrote with the config:\n>\n> $ git repo-config remote.origin.url git://git.kernel.org/pub/scm/git/git.git\n> $ git repo-config remote.origin.fetch \\\n> \trefs/heads/master:refs/remotes/origin/master\n> $ git repo-config remote.origin.fetch \\\n> \trefs/heads/next:refs/remotes/origin/next ^$\n> $ git repo-config remote.origin.fetch \\\n> \t+refs/heads/pu:refs/remotes/origin/pu ^$\n>\n\nWhat's that ^$ for?\n\n-Peter\n"},{"id":"295760","messageId":"cc723f590612060205p1fd26cd7u3c7efc723b0177de@mail.gmail.com","threadId":"43113","inReplyTo":"Pine.LNX.4.63.0612061019350.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git pull and merging.","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-12-06T10:05:15Z","receivedAt":"2006-12-06T10:05:15Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"On 12/6/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > I almost felt the branch.<name>.merge was for that.\n>\n> No. This tells git which _default_ branch to merge with. I.e.\n>\n> $ git repo-config branch.master.remote origin\n> $ git repo-config branch.master.merge next\n>\n> means that if your current branch is \"master\", a \"git pull\" _without_\n> parameters will default to the branch \"next\" of the remote \"origin\" you\n> just set up like above.\n\nThis doesn't work. So this is what i tried\ntest repository with master and devel branch\ncloned it to test.devel\n\n.git/config have\n\n[branch \"devel\"]\n        remote = origin\n        merge = devel\n\nNow IIUC this should be when i am in branch devel when i do a git pull\npull from origin remote and merge with the local branch devel  the\nremote branch devel.\n\nBut git pull says already up to date.\n\nNow i thought merge should be local reference. So i changed it to\nmerge = remotes/origin/devel.\n\nThat also didn't work.\n\nThen i tried the name of the branch should be indicated as\n\"refs/heads/devel\" . That also didn't work.\n\nSo i guess i am missing something.\n\n"},{"id":"294523","messageId":"Pine.LNX.4.63.0612061111340.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43113","inReplyTo":"slrnend551.arq.Peter.B.Baumann@xp.machine.xx","subject":"Re: git pull and merging.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-06T10:14:01Z","receivedAt":"2006-12-06T10:14:01Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 6 Dec 2006, Peter Baumann wrote:\n\n> On 2006-12-06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > You can have the same effect as what Junio wrote with the config:\n> >\n> > $ git repo-config remote.origin.url git://git.kernel.org/pub/scm/git/git.git\n> > $ git repo-config remote.origin.fetch \\\n> > \trefs/heads/master:refs/remotes/origin/master\n> > $ git repo-config remote.origin.fetch \\\n> > \trefs/heads/next:refs/remotes/origin/next ^$\n> > $ git repo-config remote.origin.fetch \\\n> > \t+refs/heads/pu:refs/remotes/origin/pu ^$\n> >\n> \n> What's that ^$ for?\n\nWe misuse the \"nice\" ini format a little bit in git: we allow multiple \nvalues for certain keys, like \"remote.origin.fetch\".\n\nThe normal mode for repo-config is to replace the value for the given key. \nBy appending a regular expression, you can limit the replacement to \ncertain matching _values_. And since \"^$\" means empty string, it does not \nmatch any, ensuring an append instead of a replace.\n\nCiao,\nDscho\n"},{"id":"294633","messageId":"20061206102338.GA28894@xp.machine.xx","threadId":"43113","inReplyTo":"Pine.LNX.4.63.0612061111340.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: git pull and merging.","fromName":"Peter Baumann","fromEmail":"siprbaum@stud.informatik.uni-erlangen.de","sentAt":"2006-12-06T10:23:38Z","receivedAt":"2006-12-06T10:23:38Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Wed, Dec 06, 2006 at 11:14:01AM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Wed, 6 Dec 2006, Peter Baumann wrote:\n> \n> > On 2006-12-06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > > You can have the same effect as what Junio wrote with the config:\n> > >\n> > > $ git repo-config remote.origin.url git://git.kernel.org/pub/scm/git/git.git\n> > > $ git repo-config remote.origin.fetch \\\n> > > \trefs/heads/master:refs/remotes/origin/master\n> > > $ git repo-config remote.origin.fetch \\\n> > > \trefs/heads/next:refs/remotes/origin/next ^$\n> > > $ git repo-config remote.origin.fetch \\\n> > > \t+refs/heads/pu:refs/remotes/origin/pu ^$\n> > >\n> > \n> > What's that ^$ for?\n> \n> We misuse the \"nice\" ini format a little bit in git: we allow multiple \n> values for certain keys, like \"remote.origin.fetch\".\n> \n> The normal mode for repo-config is to replace the value for the given key. \n> By appending a regular expression, you can limit the replacement to \n> certain matching _values_. And since \"^$\" means empty string, it does not \n> match any, ensuring an append instead of a replace.\n> \n> Ciao,\n> Dscho\n> \n\nAnother new thing learned today!\nThanks for the info.\n\n"},{"id":"295148","messageId":"el65rh$tfj$3@sea.gmane.org","threadId":"43113","inReplyTo":"cc723f590612060205p1fd26cd7u3c7efc723b0177de@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-06T10:28:00Z","receivedAt":"2006-12-06T10:28:00Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Aneesh Kumar wrote:\n\n> [branch \"devel\"]\n>         remote = origin\n>         merge = devel\n\nDoes\n\n  [branch \"refs/heads/devel\"]\n        remote = origin\n        merge = refs/remotes/origin/devel\n\nworks?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297364","messageId":"cc723f590612060248jb151a75y9e9ea316f1c6086f@mail.gmail.com","threadId":"43113","inReplyTo":"cc723f590612060248y6f730a54l3a2aadfa6500d36d@mail.gmail.com","subject":"Fwd: git pull and merging.","fromName":"Aneesh Kumar","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-12-06T10:48:52Z","receivedAt":"2006-12-06T10:48:52Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"After printing some debug echo i got this one which seems to be working for me\n\n[branch \"devel\"]\n        remote = origin\n"},{"id":"296592","messageId":"200612061744.31213.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"cc723f590612060205p1fd26cd7u3c7efc723b0177de@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-06T16:44:30Z","receivedAt":"2006-12-06T16:44:30Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Wednesday 06 December 2006 11:05, Aneesh Kumar wrote:\n> [branch \"devel\"]\n>         remote = origin\n>         merge = devel\n> \n> [....]\n> Now i thought merge should be local reference. So i changed it to\n> merge = remotes/origin/devel.\n> \n> That also didn't work.\n> \n> Then i tried the name of the branch should be indicated as\n> \"refs/heads/devel\" . That also didn't work.\n> \n> So i guess i am missing something.\n\nSee man page of git-repo-config:\n\n branch.<name>.merge\n  When in branch <name>, it tells git fetch the default\n  remote branch to be merged.\n\nI assume that the \"devel\" branch on the remote repo you cloned from\nis also \"devel\", more exactly \"refs/heads/devel\".\n\nNow, instead of \"git pull\", git should default to\n\n\tgit pull origin refs/heads/devel:refs/remotes/origin/devel\n\nie. it should update the local tracking branch \"refs/remotes/origin/devel\"\nwith the remote branch \"refs/heads/devel\".\nThe tracking branch \"refs/remotes/origin/devel\" will be merged with current\nbranch afterwards.\n\nNow looking at the documentation for branch.<name>.merge, it talks\nabout the remote branch, which is \"refs/heads/devel\" in your case, ie.\nthe first part of the refspec of the full \"git pull\" command above.\n\nSo, as you already posted (without explanation, therefore this mail),\nthe config should be\n\n [branch \"devel\"]\n         remote = origin\n         merge = refs/heads/devel\n\nHowever, \"devel\" alone should work here, as it can be matched with remote\n\"refs/heads/devel\". Seems to be a bug, as branch.<name>.merge seems to only\nbeing compared with the full canonical name in the implementation.\n\nJosef\n"},{"id":"294084","messageId":"4577B8C0.3060200@gmail.com","threadId":"43113","inReplyTo":"200612061744.31213.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@gmail.com","sentAt":"2006-12-07T06:46:24Z","receivedAt":"2006-12-07T06:46:24Z","isPatch":false,"sender":{"key":"aneesh.kumar@gmail.com","avatar":"https://gravatar.com/avatar/0621fc0b2f14ead1e9024382f16053a808c148596da30c1b92572fa075621f68?d=mp&s=160"},"body":"Josef Weidendorfer wrote:\n> On Wednesday 06 December 2006 11:05, Aneesh Kumar wrote:\n>> [branch \"devel\"]\n>>         remote = origin\n>>         merge = devel\n>>\n>> [....]\n>> Now i thought merge should be local reference. So i changed it to\n>> merge = remotes/origin/devel.\n>>\n>> That also didn't work.\n>>\n>> Then i tried the name of the branch should be indicated as\n>> \"refs/heads/devel\" . That also didn't work.\n>>\n>> So i guess i am missing something.\n> \n> See man page of git-repo-config:\n> \n>  branch.<name>.merge\n>   When in branch <name>, it tells git fetch the default\n>   remote branch to be merged.\n> \n> I assume that the \"devel\" branch on the remote repo you cloned from\n> is also \"devel\", more exactly \"refs/heads/devel\".\n> \n> Now, instead of \"git pull\", git should default to\n> \n> \tgit pull origin refs/heads/devel:refs/remotes/origin/devel\n\n\n\nthis means the remote reference is refs/heads/devel and local tracking branch for that is refs/remotes/origin/devel.\n\n\n\n\n> \n> ie. it should update the local tracking branch \"refs/remotes/origin/devel\"\n> with the remote branch \"refs/heads/devel\".\n> The tracking branch \"refs/remotes/origin/devel\" will be merged with current\n> branch afterwards.\n> \n\n\nThat will be merged is the tricky part. \n\n\n\n> Now looking at the documentation for branch.<name>.merge, it talks\n> about the remote branch, which is \"refs/heads/devel\" in your case, ie.\n> the first part of the refspec of the full \"git pull\" command above.\n> \n\nThis is most confusing part. What merge indicate is not about refs/heads/devel\nshould track refs/remotes/origin/devel. That is specfied in the remote config option.\n\nWhat merge indicate is that when in a local branch ( not the tracking one under remotes/origin)\nwhich branch from remote need to be used to merge to the local branch.\n\n\n\n\n> So, as you already posted (without explanation, therefore this mail),\n> the config should be\n> \n>  [branch \"devel\"]\n>          remote = origin\n>          merge = refs/heads/devel\n> \n> However, \"devel\" alone should work here, as it can be matched with remote\n> \"refs/heads/devel\". Seems to be a bug, as branch.<name>.merge seems to only\n> being compared with the full canonical name in the implementation.\n\n\nI guess we need to have a standard way of saying the branches. \n\nMay be we want to document it in repo-config.\n\nlocal branch on which changes can be made <branch-name>\nlocal tracking branch refs/remotes/<remote-name>/<branch-name>\nremote branch refs/heads/<branch-name>\n\n\n"},{"id":"293862","messageId":"200612071227.46194.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"4577B8C0.3060200@gmail.com","subject":"Re: git pull and merging.","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-07T11:27:45Z","receivedAt":"2006-12-07T11:27:45Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Thursday 07 December 2006 07:46, Aneesh Kumar K.V wrote:\n> Josef Weidendorfer wrote:\n\n> > Now, instead of \"git pull\", git should default to\n> > \n> > \tgit pull origin refs/heads/devel:refs/remotes/origin/devel\n> \n> \n> \n> this means the remote reference is refs/heads/devel and local tracking\n> branch for that is refs/remotes/origin/devel. \n\nYes.\n\n> > ie. it should update the local tracking branch \"refs/remotes/origin/devel\"\n> > with the remote branch \"refs/heads/devel\".\n> > The tracking branch \"refs/remotes/origin/devel\" will be merged with current\n> > branch afterwards.\n> > \n> \n> \n> That will be merged is the tricky part.\n\nNo. The merging part actually is the easiest, because everything about\nwhat to merge with what is already decided in \"git pull\" 's fetch phase:\n\n* git fetch leaves the branches fetched _and_ what to merge of them\nin .git/FETCH_HEAD. Example for \"git pull\" it git.git's master(shorted):\n\nde51fa... branch 'master' of git://.../git/git\n49ed2b... not-for-merge   branch 'maint' of git://.../git/git\nb772ef... not-for-merge   branch 'next' of git://.../git/git\n\nWhich means: Already in the fetch phase, we look up branch.*.merge to\ndecide what to write into this file.\n\n* the merge phase just looks up .git/FETCH_HEAD and merges all branches into\nthe current branch which are _not_ marked as \"not-for-merge\". There\nis nothing tricky here: We did the 1st phase of pull in the same\n\"current\" branch, so there really is no need to check any branch.*.merge\nvalue again.\n\n> > Now looking at the documentation for branch.<name>.merge, it talks\n> > about the remote branch, which is \"refs/heads/devel\" in your case, ie.\n> > the first part of the refspec of the full \"git pull\" command above.\n> > \n> \n> This is most confusing part. What merge indicate is not about refs/heads/devel\n> should track refs/remotes/origin/devel. That is specfied in the remote config option.\n\nYes. But the value of branch.*.merge, which is the _remote_ side of such a refspec\ntracking specification given in remote.*.fetch's, will be checked against all\nremote parts of refspecs fetched in the 1st phase of \"git pull\". And it is already\ndecided in the fetch phase what to merge.\n\nNow looking at it, I think this semantic really is screwed and utterly confusing.\nWhy decides branch.*.merge about actions done in fetch (I think even if you did\n\"git fetch\" alone)? OK, actually, that is an implementation detail and not\nreally important.\n\nMore important: Because \"branch.*.merge\" specifies a _remote_ branch,\nthe user has to understand that this info is already used in the fetch.\nThe intuitive mental model of a user about how it works IMHO is that\n\"branch.*.merge\" is checked in the merge phase (as the name of the option suggests).\nBut this way, how could the merge phase know about any remote branch at all,\nwhich does not need to be touched at all in the merge phase?\n\nIMHO we should somehow change the semantic of branch.*.merge to specify the _local_\nrefspec part, as this is the branch which actually gets merged.\nThis is the only way that a user could grasp the meaning of it.\nPerhaps introduce \"branch.*.defaultmerge\", and obsoleting \"branch.*.merge\"?\n\n> I guess we need to have a standard way of saying the branches. \n> \n> May be we want to document it in repo-config.\n> \n> local branch on which changes can be made <branch-name>\n> local tracking branch refs/remotes/<remote-name>/<branch-name>\n\nThis is not forced, but can be changed by configuration.\n\n> remote branch refs/heads/<branch-name>\n\n?\n\n"},{"id":"296618","messageId":"7vhcw7ttj9.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"200612071227.46194.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-07T19:06:34Z","receivedAt":"2006-12-07T19:06:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n> More important: Because \"branch.*.merge\" specifies a _remote_ branch,\n> the user has to understand that this info is already used in the fetch.\n> The intuitive mental model of a user about how it works IMHO is that\n> \"branch.*.merge\" is checked in the merge phase (as the name of the option suggests).\n> But this way, how could the merge phase know about any remote branch at all,\n> which does not need to be touched at all in the merge phase?\n\nI accepted the \"branch.*.merge\" patch long time ago but I did\nnot see the point of moving things into config back then, so I\ndid not look at the design issue deeply enough to notice that\nthis can be a source of confusion (in other words, \"I wouldn't\nuse it myself, but I've seen some people on the list wanting to\nhave it, and the submitter must have thought about what are\nneeded a lot more than myself\" did not go so well).\n\nOnce you place something like \"branch.*.merge\" in configuration\nfile (either $GIT_DIR/config, or a $GIT_DIR/remotes/* file), you\nare talking about other repositories you regularly interact\nwith, so it might be probably Ok to require the user to use a\ntracking branch if he wants the convenience of \"branch.*.merge\",\nand make its value name the local tracking branch instead of the\nremote branch.\n\nBut that means I would never be able to benefit from the\nconvenience of \"branch.*.merge\"; I pull from gitk repository to\nget updates, but I do not have (and I do not see the point to\nhave) a remote tracking branch to track it.  If you want to\ncater to people who fetch and merge without using tracking\nbranches, the remote branch name is the only sane thing you can\nuse for the value of \"branch.*.merge\".\n"},{"id":"297281","messageId":"200612072354.01830.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"7vhcw7ttj9.fsf@assigned-by-dhcp.cox.net","subject":"Re: git pull and merging.","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-07T22:54:01Z","receivedAt":"2006-12-07T22:54:01Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Thursday 07 December 2006 20:06, you wrote:\n> Once you place something like \"branch.*.merge\" in configuration\n> file (either $GIT_DIR/config, or a $GIT_DIR/remotes/* file), you\n> are talking about other repositories you regularly interact\n> with, so it might be probably Ok to require the user to use a\n> tracking branch if he wants the convenience of \"branch.*.merge\",\n> and make its value name the local tracking branch instead of the\n> remote branch.\n> \n> But that means I would never be able to benefit from the\n> convenience of \"branch.*.merge\";\n\nHmm... that's true; actually, I did not thought about people\nwhich do not want to have any tracking branches (again!). So\n\n[remote \"repo\"]\n  url = ...\n  fetch = branch1\n  fetch = branch2\n\n[branch \"mybranch1\"]\n  remote = repo\n  merge = branch1\n\nactually looks fine, and is the only possible way.\nBut still, this does not work. You have to specify\n\n  merge = refs/heads/branch1\n\nThat's confusing (perhaps I can come up with a patch\nto allow \"branch1\" alone).\n\nSo probably the best way is to write some more detailed\nexplanation into the docu ...\n\n"},{"id":"296859","messageId":"7vac1zqpa3.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"7vhcw7ttj9.fsf@assigned-by-dhcp.cox.net","subject":"Re: git pull and merging.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-07T23:06:44Z","receivedAt":"2006-12-07T23:06:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Once you place something like \"branch.*.merge\" in configuration\n> file (either $GIT_DIR/config, or a $GIT_DIR/remotes/* file), you\n> are talking about other repositories you regularly interact\n> with, so it might be probably Ok to require the user to use a\n> tracking branch if he wants the convenience of \"branch.*.merge\",\n> and make its value name the local tracking branch instead of the\n> remote branch.\n\nIn other words, I am all for fixing this.\n\nAlthough it may not hurt too much if we just redefine the\nmeaning of it to name the local tracking branch, using a\ndifferent name \"branch.*.defaultmerge\" is safer and would not\nbreak existing repositories.\n"},{"id":"296178","messageId":"8aa486160612071756s18f9530cr7ed26e4b7b47d1de@mail.gmail.com","threadId":"43113","inReplyTo":"200612072354.01830.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-08T01:56:29Z","receivedAt":"2006-12-08T01:56:29Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/7/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> On Thursday 07 December 2006 20:06, you wrote:\n> > Once you place something like \"branch.*.merge\" in configuration\n> > file (either $GIT_DIR/config, or a $GIT_DIR/remotes/* file), you\n> > are talking about other repositories you regularly interact\n> > with, so it might be probably Ok to require the user to use a\n> > tracking branch if he wants the convenience of \"branch.*.merge\",\n> > and make its value name the local tracking branch instead of the\n> > remote branch.\n> >\n> > But that means I would never be able to benefit from the\n> > convenience of \"branch.*.merge\";\n>\n> Hmm... that's true; actually, I did not thought about people\n> which do not want to have any tracking branches (again!). So\n>\n> [remote \"repo\"]\n>   url = ...\n>   fetch = branch1\n>   fetch = branch2\n>\n> [branch \"mybranch1\"]\n>   remote = repo\n>   merge = branch1\n>\n> actually looks fine, and is the only possible way.\n> But still, this does not work.\n\nIt works for me.\n\n> You have to specify\n>\n>   merge = refs/heads/branch1\n\nIt does not.\n\nThe merge line must match exactly the remote part of the refspec.\n\n>\n> That's confusing (perhaps I can come up with a patch\n> to allow \"branch1\" alone).\n>\n> So probably the best way is to write some more detailed\n> explanation into the docu ...\n\nPerhaps that the branch.<name>.remote and branch.<name>.merge have the\nequivalent meaning as the parameters of git-pull?\n\n>\n> Josef\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"295942","messageId":"8aa486160612071804t63a86b5ate6b17d8ddcf90a60@mail.gmail.com","threadId":"43113","inReplyTo":"7vac1zqpa3.fsf@assigned-by-dhcp.cox.net","subject":"Re: git pull and merging.","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-08T02:04:21Z","receivedAt":"2006-12-08T02:04:21Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/8/06, Junio C Hamano <junkio@cox.net> wrote:\n> Junio C Hamano <junkio@cox.net> writes:\n>\n> > Once you place something like \"branch.*.merge\" in configuration\n> > file (either $GIT_DIR/config, or a $GIT_DIR/remotes/* file), you\n> > are talking about other repositories you regularly interact\n> > with, so it might be probably Ok to require the user to use a\n> > tracking branch if he wants the convenience of \"branch.*.merge\",\n> > and make its value name the local tracking branch instead of the\n> > remote branch.\n>\n> In other words, I am all for fixing this.\n>\n> Although it may not hurt too much if we just redefine the\n> meaning of it to name the local tracking branch, using a\n> different name \"branch.*.defaultmerge\" is safer and would not\n> break existing repositories.\n\nOr branch.*.localmerge?\n\n"},{"id":"296766","messageId":"7vvekmn9vm.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"200612072354.01830.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T07:07:41Z","receivedAt":"2006-12-08T07:07:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n>> But that means I would never be able to benefit from the\n>> convenience of \"branch.*.merge\";\n>\n> Hmm... that's true; actually, I did not thought about people\n> which do not want to have any tracking branches (again!). So\n>\n> [remote \"repo\"]\n>   url = ...\n>   fetch = branch1\n>   fetch = branch2\n>\n> [branch \"mybranch1\"]\n>   remote = repo\n>   merge = branch1\n>\n> actually looks fine, and is the only possible way.\n\nYeah, when you lay it out that way, it absolutely makes sense to\nhave \"branch1\" which is the name of the remote branch, not the\nlocal counterpart that tracks it, as the value of the \"merge\"\nconfiguration.\n\n> But still, this does not work. You have to specify\n>\n>   merge = refs/heads/branch1\n>\n> That's confusing (perhaps I can come up with a patch\n> to allow \"branch1\" alone).\n\nI think that might make things easier to read, but it might\nintroduce ambiguities, especially you do not control the set of\nremote branches and tags.\n"},{"id":"298614","messageId":"elbj9g$og4$1@sea.gmane.org","threadId":"43113","inReplyTo":"200612071227.46194.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-08T11:48:08Z","receivedAt":"2006-12-08T11:48:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Josef Weidendorfer wrote:\n\n> Now looking at it, I think this semantic really is screwed and utterly confusing.\n> Why decides branch.*.merge about actions done in fetch (I think even if you did\n> \"git fetch\" alone)? OK, actually, that is an implementation detail and not\n> really important.\n> \n> More important: Because \"branch.*.merge\" specifies a _remote_ branch,\n> the user has to understand that this info is already used in the fetch.\n> The intuitive mental model of a user about how it works IMHO is that\n> \"branch.*.merge\" is checked in the merge phase (as the name of the option suggests).\n> But this way, how could the merge phase know about any remote branch at all,\n> which does not need to be touched at all in the merge phase?\n> \n> IMHO we should somehow change the semantic of branch.*.merge to specify the _local_\n> refspec part, as this is the branch which actually gets merged.\n> This is the only way that a user could grasp the meaning of it.\n> Perhaps introduce \"branch.*.defaultmerge\", and obsoleting \"branch.*.merge\"?\n\nThe change of semantic would prohibit the \"pull without tracking branch\"\nsemantic (probably not used anymore, since git supports multiple heads\nfrom long time).\n\nI proposed in another thread to allow to either specify full refspec (in\naddition to current specifying remote branch), or ':' and local branch.\nOr perhaps add branch.*.localmerge configuration option?\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"298039","messageId":"200612081823.45565.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"8aa486160612071756s18f9530cr7ed26e4b7b47d1de@mail.gmail.com","subject":"Re: git pull and merging.","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-08T17:23:45Z","receivedAt":"2006-12-08T17:23:45Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Friday 08 December 2006 02:56, Santi Béjar wrote:\n> > [remote \"repo\"]\n> >   url = ...\n> >   fetch = branch1\n> >   fetch = branch2\n> >\n> > [branch \"mybranch1\"]\n> >   remote = repo\n> >   merge = branch1\n> >\n> > actually looks fine, and is the only possible way.\n> > But still, this does not work.\n> \n> It works for me.\n> \n> > You have to specify\n> >\n> >   merge = refs/heads/branch1\n> \n> It does not.\n> \n> The merge line must match exactly the remote part of the refspec.\n\nYes, you are right; I just looked it up in git-parse-remote.\nSorry about any confusion.\n\n> \n> >\n> > That's confusing (perhaps I can come up with a patch\n> > to allow \"branch1\" alone).\n> >\n> > So probably the best way is to write some more detailed\n> > explanation into the docu ...\n> \n> Perhaps that the branch.<name>.remote and branch.<name>.merge have the\n> equivalent meaning as the parameters of git-pull?\n\nWe want to fetch multiple refs from one remote in a row. So what\nare you proposing? That branch.<name>.merge has to exactly\nspecify one remote? I do not think this is needed.\n\nActually, I am really for a new branch.<name>.localmerge option,\nand keeping branch.<name>.merge (but not advertising it).\n\n"},{"id":"296006","messageId":"200612082012.19167.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"200612081823.45565.Josef.Weidendorfer@gmx.de","subject":"[PATCH] Add branch.*.localmerge and documentation update","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-08T19:12:18Z","receivedAt":"2006-12-08T19:12:18Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"Clarify the meaning of branch.*.merge option and add a similar\nbranch.*.localmerge option, which can be used to specify a local\ntracking branch to be merged by default.\n\nPreviously, if branch.*.merge was specified but did not match any\nref, the message \"No changes.\" was not really helpful regarding\nthe misconfiguration. This now gives a warning.\n\nThe value of branch.*.merge can be a list to get an octopus\nmerge. I chose the same way for branch.*.localmerge, and if\nyou specify both options, the octopus merge will have even\nmore parents ;-)\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n---\n\nThis implements to branch.*.localmerge option as counterpart\nto branch.*.merge as discussed.\n\nTo get the \"No default merge when any branch.*.(local)merge is given,\nbut not in current branch\" feature, what is the way to check this,\nas git-repo-config can not match with regexps against config keys?\n\nJosef\n\n Documentation/config.txt |   23 +++++++++++++++++++++--\n git-parse-remote.sh      |   40 +++++++++++++++++++++++++++++++---------\n 2 files changed, 52 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 9090762..6e19130 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -125,10 +125,29 @@ apply.whitespace::\n \n branch.<name>.remote::\n \tWhen in branch <name>, it tells `git fetch` which remote to fetch.\n+\tIf this option is not given, `git fetch` defaults to \"origin\".\n \n branch.<name>.merge::\n-\tWhen in branch <name>, it tells `git fetch` the default remote branch\n-\tto be merged.\n+\tWhen in branch <name>, it tells `git fetch` the default refspec to\n+\tbe marked for merging in FETCH_HEAD. The value has to exactly\n+\tmatch a remote part of the refspecs which are fetched from the remote\n+\trepository given by \"branch.<name>.remote\".\n+\tThe merge information is used by `git pull` (which first calls\n+\t`git fetch`) for the default merge action.\n+\tWithout this or a \"branch.<name>.localmerge\" option, `git pull` defaults to\n+\tthe first refspec fetched.\n+\tSpecify multiple values to get an octopus merge.\n+\n+branch.<name>.localmerge::\n+\tWhen in branch <name>, it tells `git fetch` the default refspec to\n+\tbe marked for merging in FETCH_HEAD. The value has to exactly\n+\tmatch a local part (i.e. the local tracking branch) of the refspecs\n+\twhich are fetched from the remote repository given by \"branch.<name>.remote\".\n+\tThe merge information is used by `git pull` (which first calls\n+\t`git fetch`) for the default merge action.\n+\tWithout this or a \"branch.<name>.merge\" option, `git pull` defaults to the\n+\tfirst refspec fetched.\n+\tSpecify multiple values to get an octopus merge.\n \n pager.color::\n \tA boolean to enable/disable colored output when the pager is in\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex da064a5..08ab272 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -133,7 +133,9 @@ canon_refs_list_for_fetch () {\n \t# leave the branches in branch.${curr_branch}.merge alone,\n \t# or the first one otherwise; add prefix . to the rest\n \t# to prevent the secondary branches to be merged by default.\n-\tmerge_branches=\n+\tmerge_remotebranches=\n+\tmerge_localbranches=\n+\tfound_mergerefs=\n \tif test \"$1\" = \"-d\"\n \tthen\n \t\tshift ; remote=\"$1\" ; shift\n@@ -141,8 +143,10 @@ canon_refs_list_for_fetch () {\n \t\tthen\n \t\t\tcurr_branch=$(git-symbolic-ref HEAD | \\\n \t\t\t    sed -e 's|^refs/heads/||')\n-\t\t\tmerge_branches=$(git-repo-config \\\n+\t\t\tmerge_remotebranches=$(git-repo-config \\\n \t\t\t    --get-all \"branch.${curr_branch}.merge\")\n+\t\t\tmerge_localbranches=$(git-repo-config \\\n+\t\t\t    --get-all \"branch.${curr_branch}.localmerge\")\n \t\tfi\n \t\tset x $(expand_refs_wildcard \"$@\")\n \t\tshift\n@@ -160,17 +164,31 @@ canon_refs_list_for_fetch () {\n \t\tremote=$(expr \"z$ref\" : 'z\\([^:]*\\):')\n \t\tlocal=$(expr \"z$ref\" : 'z[^:]*:\\(.*\\)')\n \t\tdot_prefix=.\n-\t\tif test -z \"$merge_branches\"\n+\t\tif test ! -z \"$merge_remotebranches\"\n \t\tthen\n-\t\t\tmerge_branches=$remote\n-\t\t\tdot_prefix=\n-\t\telse\n-\t\t\tfor merge_branch in $merge_branches\n+\t\t\tfor merge_branch in $merge_remotebranches\n \t\t\tdo\n-\t\t\t    [ \"$remote\" = \"$merge_branch\" ] &&\n-\t\t\t    dot_prefix= && break\n+\t\t\t\t[ \"$remote\" = \"$merge_branch\" ] &&\n+\t\t\t\tdot_prefix= && break\n \t\t\tdone\n \t\tfi\n+\t\tif test ! -z \"$merge_localbranches\"\n+\t\tthen\n+\t\t\tfor merge_branch in $merge_localbranches\n+\t\t\tdo\n+\t\t\t\t[ \"$local\" = \"$merge_branch\" ] &&\n+\t\t\t\tdot_prefix= && break\n+\t\t\tdone\n+\t\tfi\n+\t\tif test -z \"$merge_remotebranches\" -a -z \"$merge_localbranches\"\n+\t\tthen\n+\t\t\tmerge_remotebranches=$remote\n+\t\t\tdot_prefix=\n+\t\tfi\n+\t\tif test -z $dot_prefix\n+\t\tthen\n+\t\t\tfound_mergeref=true\n+\t\tfi\n \t\tcase \"$remote\" in\n \t\t'') remote=HEAD ;;\n \t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n@@ -191,6 +209,10 @@ canon_refs_list_for_fetch () {\n \t\tfi\n \t\techo \"${dot_prefix}${force}${remote}:${local}\"\n \tdone\n+\tif test -z $found_mergeref\n+\tthen\n+\t\techo >&2 \"Warning: No merge candidate because of no match with branch.*.merge or branch.*.localmerge\"\n+\tfi\n }\n \n # Returns list of src: (no store), or src:dst (store)\n-- \n"},{"id":"295501","messageId":"8aa486160612081209r91a35f4v4e495357791a934c@mail.gmail.com","threadId":"43113","inReplyTo":"200612081823.45565.Josef.Weidendorfer@gmx.de","subject":"Re: git pull and merging.","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-08T20:09:27Z","receivedAt":"2006-12-08T20:09:27Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> On Friday 08 December 2006 02:56, Santi Béjar wrote:\n> > > [remote \"repo\"]\n> > >   url = ...\n> > >   fetch = branch1\n> > >   fetch = branch2\n> > >\n> > > [branch \"mybranch1\"]\n> > >   remote = repo\n> > >   merge = branch1\n> > >\n> > > actually looks fine, and is the only possible way.\n> > > But still, this does not work.\n> >\n> > It works for me.\n> >\n> > > You have to specify\n> > >\n> > >   merge = refs/heads/branch1\n> >\n> > It does not.\n> >\n> > The merge line must match exactly the remote part of the refspec.\n>\n> Yes, you are right; I just looked it up in git-parse-remote.\n> Sorry about any confusion.\n>\n> >\n> > >\n> > > That's confusing (perhaps I can come up with a patch\n> > > to allow \"branch1\" alone).\n> > >\n> > > So probably the best way is to write some more detailed\n> > > explanation into the docu ...\n> >\n> > Perhaps that the branch.<name>.remote and branch.<name>.merge have the\n> > equivalent meaning as the parameters of git-pull?\n>\n> We want to fetch multiple refs from one remote in a row. So what\n> are you proposing? That branch.<name>.merge has to exactly\n> specify one remote? I do not think this is needed.\n\nI'm not proposing anything. What I wanted to say is that we could\ndocument the ...remote and ...merge configs as the default parameters\nof git-pull (this is how it is implemented already).\n\n>\n> Actually, I am really for a new branch.<name>.localmerge option,\n> and keeping branch.<name>.merge (but not advertising it).\n\nI do not see anything wrong with the current ...remote and ...merge\n(see above), but I'm not against the ...localmerge config.\n\n"},{"id":"294000","messageId":"8aa486160612081252t1e245104x58c8a6654d887af5@mail.gmail.com","threadId":"43113","inReplyTo":"200612082012.19167.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-08T20:52:15Z","receivedAt":"2006-12-08T20:52:15Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> Clarify the meaning of branch.*.merge option and add a similar\n> branch.*.localmerge option, which can be used to specify a local\n> tracking branch to be merged by default.\n>\n> Previously, if branch.*.merge was specified but did not match any\n> ref, the message \"No changes.\" was not really helpful regarding\n> the misconfiguration. This now gives a warning.\n>\n> The value of branch.*.merge can be a list to get an octopus\n> merge. I chose the same way for branch.*.localmerge, and if\n> you specify both options, the octopus merge will have even\n> more parents ;-)\n>\n> Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n\nAck for the documentation part. But the localmerge part is almost\nequivalent to my patch to allow the branch.<name>.remote equal to \".\".\n\n"},{"id":"297671","messageId":"7vr6vagja6.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"8aa486160612081252t1e245104x58c8a6654d887af5@mail.gmail.com","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T21:38:41Z","receivedAt":"2006-12-08T21:38:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n> On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n>> Clarify the meaning of branch.*.merge option and add a similar\n>> branch.*.localmerge option, which can be used to specify a local\n>> tracking branch to be merged by default.\n>>\n>> Previously, if branch.*.merge was specified but did not match any\n>> ref, the message \"No changes.\" was not really helpful regarding\n>> the misconfiguration. This now gives a warning.\n>>\n>> The value of branch.*.merge can be a list to get an octopus\n>> merge. I chose the same way for branch.*.localmerge, and if\n>> you specify both options, the octopus merge will have even\n>> more parents ;-)\n>>\n>> Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n>\n> Ack for the documentation part. But the localmerge part is almost\n> equivalent to my patch to allow the branch.<name>.remote equal to \".\".\n\nI am not so sure about the \"localmerge\" stuff anymore.\n\nWhat convenience would it buy us (including but not limited to\nnew people), and if there is any, would that outweigh the\npotential confusion factor to have two different configuration\nvariables that do exactly the same thing whose sole difference\nis which side of the fetched branch namespace it uses to specify\nthe merge source?\n\n"},{"id":"293954","messageId":"200612082239.38423.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"8aa486160612081252t1e245104x58c8a6654d887af5@mail.gmail.com","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-08T21:39:38Z","receivedAt":"2006-12-08T21:39:38Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Friday 08 December 2006 21:52, Santi Béjar wrote:\n> On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> > Clarify the meaning of branch.*.merge option and add a similar\n> > branch.*.localmerge option, which can be used to specify a local\n> > tracking branch to be merged by default.\n> >\n> > Previously, if branch.*.merge was specified but did not match any\n> > ref, the message \"No changes.\" was not really helpful regarding\n> > the misconfiguration. This now gives a warning.\n> >\n> > The value of branch.*.merge can be a list to get an octopus\n> > merge. I chose the same way for branch.*.localmerge, and if\n> > you specify both options, the octopus merge will have even\n> > more parents ;-)\n> >\n> > Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n> \n> Ack for the documentation part. But the localmerge part is almost\n> equivalent to my patch to allow the branch.<name>.remote equal to \".\".\n\nInteresting. I did not have a look at your patch.\nThe support for the \"branch.*.localmerge\" option is one step to be\nable to support a remote \".\". So of course, it probably is similar.\nI even would say that \".\" as remote now actually makes sense as\nlogical extension.\n\nHowever, what would you change in the implementation part of my patch?\n\n"},{"id":"297130","messageId":"elcmen$pm6$1@sea.gmane.org","threadId":"43113","inReplyTo":"7vr6vagja6.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-08T21:48:17Z","receivedAt":"2006-12-08T21:48:17Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"<opublikowany i wysłany>\n\nJunio C Hamano wrote:\n\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n> \n>> On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n>>> Clarify the meaning of branch.*.merge option and add a similar\n>>> branch.*.localmerge option, which can be used to specify a local\n>>> tracking branch to be merged by default.\n>>>\n>>> Previously, if branch.*.merge was specified but did not match any\n>>> ref, the message \"No changes.\" was not really helpful regarding\n>>> the misconfiguration. This now gives a warning.\n[...]\n>>\n>> Ack for the documentation part. But the localmerge part is almost\n>> equivalent to my patch to allow the branch.<name>.remote equal to \".\".\n> \n> I am not so sure about the \"localmerge\" stuff anymore.\n> \n> What convenience would it buy us (including but not limited to\n> new people), and if there is any, would that outweigh the\n> potential confusion factor to have two different configuration\n> variables that do exactly the same thing whose sole difference\n> is which side of the fetched branch namespace it uses to specify\n> the merge source?\n\nWhat about my proposal to allow for full refspec, or :<localbranch>\nto be specified? I.e. allow all the following forms:\n  branch.<name>.merge = refs/heads/<remotebranch>\n  branch.<name>.merge = refs/heads/<remotebranch>:refs/remotes/<remote>/<localbranch>\n  branch.<name>.merge = :refs/remotes/<remote>/<localbranch>\n\nBy the way, if branch.*.remote is equal to \".\", remote branch is\nlocal branch.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"294452","messageId":"200612082301.57037.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"7vr6vagja6.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-08T22:01:56Z","receivedAt":"2006-12-08T22:01:56Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Friday 08 December 2006 22:38, Junio C Hamano wrote:\n> \"Santi Béjar\" <sbejar@gmail.com> writes:\n> \n> > On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> >> Clarify the meaning of branch.*.merge option and add a similar\n> >> branch.*.localmerge option, which can be used to specify a local\n> >> tracking branch to be merged by default.\n> \n> I am not so sure about the \"localmerge\" stuff anymore.\n> \n> What convenience would it buy us (including but not limited to\n> new people), and if there is any, would that outweigh the\n> potential confusion factor to have two different configuration\n> variables that do exactly the same thing whose sole difference\n> is which side of the fetched branch namespace it uses to specify\n> the merge source?\n\nI just came up with a concrete patch.\nI am not saying that this is the only true solution.\n\nActually, Jakubs one with allowing arbitrary refspecs is nice.\nThe only problem is that it is not consistent which refspec\nshortcuts otherwise, or?\n\nHowever, you should take the documentation part and the warning\nwhen there is no match .\n\n"},{"id":"296237","messageId":"8aa486160612081415h30a35c09lc273fd34f1dbceed@mail.gmail.com","threadId":"43113","inReplyTo":"200612082239.38423.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-08T22:15:28Z","receivedAt":"2006-12-08T22:15:28Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> On Friday 08 December 2006 21:52, Santi Béjar wrote:\n> > On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> > > Clarify the meaning of branch.*.merge option and add a similar\n> > > branch.*.localmerge option, which can be used to specify a local\n> > > tracking branch to be merged by default.\n> > >\n> > > Previously, if branch.*.merge was specified but did not match any\n> > > ref, the message \"No changes.\" was not really helpful regarding\n> > > the misconfiguration. This now gives a warning.\n> > >\n> > > The value of branch.*.merge can be a list to get an octopus\n> > > merge. I chose the same way for branch.*.localmerge, and if\n> > > you specify both options, the octopus merge will have even\n> > > more parents ;-)\n> > >\n> > > Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n> >\n> > Ack for the documentation part. But the localmerge part is almost\n> > equivalent to my patch to allow the branch.<name>.remote equal to \".\".\n>\n> Interesting. I did not have a look at your patch.\n> The support for the \"branch.*.localmerge\" option is one step to be\n> able to support a remote \".\". So of course, it probably is similar.\n> I even would say that \".\" as remote now actually makes sense as\n> logical extension.\n>\n> However, what would you change in the implementation part of my patch?\n\nI would only take the documentation part (without the localmerge part)\nand the test for the warning.\n\n"},{"id":"298765","messageId":"7v1wnaggp7.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"200612082301.57037.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T22:34:28Z","receivedAt":"2006-12-08T22:34:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n> On Friday 08 December 2006 22:38, Junio C Hamano wrote:\n>> \"Santi Béjar\" <sbejar@gmail.com> writes:\n>> \n>> > On 12/8/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n>> >> Clarify the meaning of branch.*.merge option and add a similar\n>> >> branch.*.localmerge option, which can be used to specify a local\n>> >> tracking branch to be merged by default.\n>> \n>> I am not so sure about the \"localmerge\" stuff anymore.\n>> \n>> What convenience would it buy us (including but not limited to\n>> new people), and if there is any, would that outweigh the\n>> potential confusion factor to have two different configuration\n>> variables that do exactly the same thing whose sole difference\n>> is which side of the fetched branch namespace it uses to specify\n>> the merge source?\n>\n> I just came up with a concrete patch.\n> I am not saying that this is the only true solution.\n\nI admit that I do not use branch.*.merge and I do not know what\npeople find lacking in what Santi did in late September with\ncommit 5372806.  What problem are we trying to solve (not a\nrhetorical question -- I am truly lost here)?  Is it only a\nconfusion between remote and local, or is there something that\ncannot be expressed with the current scheme?\n\n> Actually, Jakubs one with allowing arbitrary refspecs is nice.\n> The only problem is that it is not consistent which refspec\n> shortcuts otherwise, or?\n\nActually I had a quite opposite reaction about allowing src:dst\nnotation there.  Does it solve any real problem?  It is unclear\nto me.  On the other hand, it gives a false impression that it\ncan be used instead of remote.*.fetch to copy the remote branch\ninto local tracking branch, and raises other questions such as\nwhat should happen when you have both, i.e. src:dst is given to\nboth remote.*.fetch and branch.*.merge, and they do not agree.\nWhich means it only adds to the confusion.\n\nSo I do not think it is worth spending brain cycles talking\nabout that particular one; it does not even have a patch to \nimplement it.\n\nBut you have a concrete patch, and if it is fixing a real\nproblem, then that is worth talking about.  I just do not know\nif a problem exists, other than that people can get confused and\nwrite local tracking branch name by mistake when it should be\nremote branch name.\n"},{"id":"297465","messageId":"200612090017.44105.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"7v1wnaggp7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-08T23:17:43Z","receivedAt":"2006-12-08T23:17:43Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Friday 08 December 2006 23:34, Junio C Hamano wrote:\n> >> What convenience would it buy us (including but not limited to\n> >> new people), and if there is any, would that outweigh the\n> >> potential confusion factor to have two different configuration\n> >> variables that do exactly the same thing whose sole difference\n> >> is which side of the fetched branch namespace it uses to specify\n> >> the merge source?\n> >\n> > I just came up with a concrete patch.\n> > I am not saying that this is the only true solution.\n> \n> I admit that I do not use branch.*.merge and I do not know what\n> people find lacking in what Santi did in late September with\n> commit 5372806.  What problem are we trying to solve (not a\n> rhetorical question -- I am truly lost here)?  Is it only a\n> confusion between remote and local, or is there something that\n> cannot be expressed with the current scheme?\n\nMore or less, yes.\n\nWhen this thread started, I remembered being bitten exactly by\nthis issue. And I only understood my problem after looking and\ntrying to understand the code.\nTherefore, it was quite easy to come up with this patch.\n\nIMHO, a problem really is the people do not want to read documentation.\nThey see the branch.*.merge option in .git/config, and try to build\ntheir own mental model how it works.\n\nPerhaps the warning I added now would have been enough for me to see\nmy error; it points at the misconfigured option. For sure, I would\nhave looked up the manual for the meaning of this option after seeing\nthe warning.\nBut the previous documentation simply was way to short.\n\nShould I send a \"simplified\" patch?\n\n"},{"id":"298723","messageId":"7vu006ez1i.fsf@assigned-by-dhcp.cox.net","threadId":"43113","inReplyTo":"200612090017.44105.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Add branch.*.localmerge and documentation update","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T23:41:13Z","receivedAt":"2006-12-08T23:41:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n> But the previous documentation simply was way to short.\n\nYes, your documentation updates seems to make it much clearer.\n\n> Should I send a \"simplified\" patch?\n\nThanks, appreciated.\n"},{"id":"294918","messageId":"200612090228.26722.Josef.Weidendorfer@gmx.de","threadId":"43113","inReplyTo":"7vu006ez1i.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Add branch.*.merge warning and documentation update","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-12-09T01:28:26Z","receivedAt":"2006-12-09T01:28:26Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"This patch clarifies the meaning of the branch.*.merge option.\nPreviously, if branch.*.merge was specified but did not match any\nref, the message \"No changes.\" was not really helpful regarding\nthe misconfiguration. This patch adds a warning for this.\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n---\n\nOn Saturday 09 December 2006 00:41, Junio C Hamano wrote:\n> Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n> \n> > But the previous documentation simply was way to short.\n> \n> Yes, your documentation updates seems to make it much clearer.\n> \n> > Should I send a \"simplified\" patch?\n> \n> Thanks, appreciated.\n\nDone.\n\nJosef\n\n Documentation/config.txt |   11 +++++++++--\n git-parse-remote.sh      |   11 +++++++++++\n 2 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 9090762..21ec557 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -125,10 +125,17 @@ apply.whitespace::\n \n branch.<name>.remote::\n \tWhen in branch <name>, it tells `git fetch` which remote to fetch.\n+\tIf this option is not given, `git fetch` defaults to remote \"origin\".\n \n branch.<name>.merge::\n-\tWhen in branch <name>, it tells `git fetch` the default remote branch\n-\tto be merged.\n+\tWhen in branch <name>, it tells `git fetch` the default refspec to\n+\tbe marked for merging in FETCH_HEAD. The value has exactly to match\n+\ta remote part of one of the refspecs which are fetched from the remote\n+\tgiven by \"branch.<name>.remote\".\n+\tThe merge information is used by `git pull` (which at first calls\n+\t`git fetch`) to lookup the default branch for merging. Without\n+\tthis option, `git pull` defaults to merge the first refspec fetched.\n+\tSpecify multiple values to get an octopus merge.\n \n pager.color::\n \tA boolean to enable/disable colored output when the pager is in\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex da064a5..d72f061 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -134,6 +134,8 @@ canon_refs_list_for_fetch () {\n \t# or the first one otherwise; add prefix . to the rest\n \t# to prevent the secondary branches to be merged by default.\n \tmerge_branches=\n+\tfound_mergeref=\n+\tcurr_branch=\n \tif test \"$1\" = \"-d\"\n \tthen\n \t\tshift ; remote=\"$1\" ; shift\n@@ -171,6 +173,10 @@ canon_refs_list_for_fetch () {\n \t\t\t    dot_prefix= && break\n \t\t\tdone\n \t\tfi\n+\t\tif test -z $dot_prefix\n+\t\tthen\n+\t\t\tfound_mergeref=true\n+\t\tfi\n \t\tcase \"$remote\" in\n \t\t'') remote=HEAD ;;\n \t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n@@ -191,6 +197,11 @@ canon_refs_list_for_fetch () {\n \t\tfi\n \t\techo \"${dot_prefix}${force}${remote}:${local}\"\n \tdone\n+\tif test -z \"$found_mergeref\" -a \"$curr_branch\"\n+\tthen\n+\t\techo >&2 \"Warning: No merge candidate found because value of config option\n+         \\\"branch.${curr_branch}.merge\\\" does not match any remote branch fetched.\"\n+\tfi\n }\n \n # Returns list of src: (no store), or src:dst (store)\n-- \n1.4.4.2.g1d08-dirty\n"},{"id":"295438","messageId":"8aa486160612090814n4c4ee827o905674618c97eeea@mail.gmail.com","threadId":"43113","inReplyTo":"200612090228.26722.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Add branch.*.merge warning and documentation update","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-12-09T16:14:12Z","receivedAt":"2006-12-09T16:14:12Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 12/9/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:\n> This patch clarifies the meaning of the branch.*.merge option.\n> Previously, if branch.*.merge was specified but did not match any\n> ref, the message \"No changes.\" was not really helpful regarding\n> the misconfiguration. This patch adds a warning for this.\n>\n> Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n\nAcked-by: Santi Béjar <sbejar@gmail.com>\n\nAnd thanks for the patch.\n\n"}]}