{"thread":{"id":"6619","subject":"[PATCH 0/3] Update to stgit parent tracking","startedAt":"2007-02-01T23:47:54Z","lastAt":"2007-02-04T02:38:18Z","messageCount":21,"participants":["Yann Dirson","Catalin Marinas","Jakub Narebski","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"33314","messageId":"20070201234534.3313.10426.stgit@gandelf.nowhere.earth","threadId":"6619","inReplyTo":null,"subject":"[PATCH 0/3] Update to stgit parent tracking","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-01T23:47:54Z","receivedAt":"2007-02-01T23:47:54Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"The following series brings a couple of improvements to parent- and\nremote-handling stuff, including addressing the FIXME you pointed to\nin your reply.\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"},{"id":"33315","messageId":"20070201234759.3313.51174.stgit@gandelf.nowhere.earth","threadId":"6619","inReplyTo":"20070201234534.3313.10426.stgit@gandelf.nowhere.earth","subject":"[PATCH 1/3] The user does not want to mess with the refspecs.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-01T23:48:00Z","receivedAt":"2007-02-01T23:48:00Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThe only use I know of for this parameter is 'stg pull . <branch>',\nfor which 'stg rebase <branch>' should be used instead.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n stgit/commands/pull.py |   13 ++++---------\n 1 files changed, 4 insertions(+), 9 deletions(-)\n\ndiff --git a/stgit/commands/pull.py b/stgit/commands/pull.py\nindex 0608fb6..f837fd4 100644\n--- a/stgit/commands/pull.py\n+++ b/stgit/commands/pull.py\n@@ -24,7 +24,7 @@ from stgit import stack, git\n \n \n help = 'pull the changes from the remote repository'\n-usage = \"\"\"%prog [options] [<repository>] [<refspec>]\n+usage = \"\"\"%prog [options] [<repository>]\n \n Pull the latest changes from the given repository (defaulting to\n 'origin'). This command works by popping all the patches from the\n@@ -34,8 +34,7 @@ of the stack to the latest parent HEAD and pushing the patches back\n there are conflicts. They need to be resolved and the patch pushed\n again.\n \n-Check the 'git pull' documentation for the <repository> and <refspec>\n-format.\"\"\"\n+Check the 'git pull' documentation for the <repository> format.\"\"\"\n \n options = [make_option('-n', '--nopush',\n                        help = 'do not push the patches back after pulling',\n@@ -47,7 +46,7 @@ options = [make_option('-n', '--nopush',\n def func(parser, options, args):\n     \"\"\"Pull the changes from a remote repository\n     \"\"\"\n-    if len(args) > 2:\n+    if len(args) > 1:\n         parser.error('incorrect number of arguments')\n \n     if len(args) >= 1:\n@@ -55,10 +54,6 @@ def func(parser, options, args):\n     else:\n         repository = crt_series.get_parent_remote()\n \n-    refspec = None\n-    if len(args) == 2:\n-        refspec = args[1]\n-\n     if crt_series.get_protected():\n         raise CmdException, 'This branch is protected. Pulls are not permitted'\n \n@@ -76,7 +71,7 @@ def func(parser, options, args):\n \n     # pull the remote changes\n     print 'Pulling from \"%s\"...' % repository\n-    git.pull(repository, refspec)\n+    git.pull(repository)\n     print 'done'\n \n     # push the patches back\n"},{"id":"33317","messageId":"20070201234805.3313.20525.stgit@gandelf.nowhere.earth","threadId":"6619","inReplyTo":"20070201234534.3313.10426.stgit@gandelf.nowhere.earth","subject":"[PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-01T23:48:05Z","receivedAt":"2007-02-01T23:48:05Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nPreviously we were just assuming that the remote from which we\njust failed defined a local branch whose name was the same as the\nremote def, and that this branch was the parent.  While this is true\nfor the most common case (branch \"origin\" from remote \"origin\"), it is\nquite an unflexible assumption.\n\nAlso move the rebasing from git.pull to commands.pull.func since that\nis clearly stgit-level stuff, and rename git.pull() to git.fetch() to\nmatch default behaviour.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n stgit/commands/pull.py |   20 +++++++++++---------\n stgit/git.py           |   10 +++-------\n 2 files changed, 14 insertions(+), 16 deletions(-)\n\ndiff --git a/stgit/commands/pull.py b/stgit/commands/pull.py\nindex f837fd4..15bbed6 100644\n--- a/stgit/commands/pull.py\n+++ b/stgit/commands/pull.py\n@@ -26,15 +26,15 @@ from stgit import stack, git\n help = 'pull the changes from the remote repository'\n usage = \"\"\"%prog [options] [<repository>]\n \n-Pull the latest changes from the given repository (defaulting to\n-'origin'). This command works by popping all the patches from the\n-stack, pulling the changes in the parent repository, setting the base\n-of the stack to the latest parent HEAD and pushing the patches back\n-(unless '--nopush' is specified). The 'push' operation can fail if\n-there are conflicts. They need to be resolved and the patch pushed\n-again.\n+Pull the latest changes from the given remote repository (defaulting\n+to branch.<name>.remote, or 'origin' if not set). This command works\n+by popping all the patches from the stack, pulling the changes in the\n+parent repository, setting the base of the stack to the latest parent\n+HEAD and pushing the patches back (unless '--nopush' is specified).\n+The 'push' operation can fail if there are conflicts. They need to be\n+resolved and the patch pushed again.\n \n-Check the 'git pull' documentation for the <repository> format.\"\"\"\n+Check the 'git fetch' documentation for the <repository> format.\"\"\"\n \n options = [make_option('-n', '--nopush',\n                        help = 'do not push the patches back after pulling',\n@@ -71,7 +71,9 @@ def func(parser, options, args):\n \n     # pull the remote changes\n     print 'Pulling from \"%s\"...' % repository\n-    git.pull(repository)\n+    git.fetch(repository)\n+    if (config.get('stgit.pull-does-rebase')):\n+        git.reset(tree_id = git.rev_parse(crt_series.get_parent_branch()))\n     print 'done'\n \n     # push the patches back\ndiff --git a/stgit/git.py b/stgit/git.py\nindex e30b959..49ebae1 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -807,9 +807,9 @@ def reset(files = None, tree_id = None, check_out = True):\n     if not files:\n         __set_head(tree_id)\n \n-def pull(repository = 'origin', refspec = None):\n-    \"\"\"Pull changes from the remote repository. Uses 'git-fetch'\n-    and moves the stack base.\n+def fetch(repository = 'origin', refspec = None):\n+    \"\"\"Fetches changes from the remote repository, using 'git-fetch'\n+    by default.\n     \"\"\"\n     # we update the HEAD\n     __clear_head_cache()\n@@ -822,10 +822,6 @@ def pull(repository = 'origin', refspec = None):\n     if __run(command, args) != 0:\n         raise GitException, 'Failed \"%s %s\"' % (command, repository)\n \n-    if (config.get('stgit.pull-does-rebase')):\n-        # FIXME!\n-        reset(tree_id = rev_parse(repository))\n-\n def repack():\n     \"\"\"Repack all objects into a single pack\n     \"\"\"\n"},{"id":"33316","messageId":"20070201234810.3313.72720.stgit@gandelf.nowhere.earth","threadId":"6619","inReplyTo":"20070201234534.3313.10426.stgit@gandelf.nowhere.earth","subject":"[PATCH 3/3] Do not return 'origin' as parent remote when there is no such remote.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-01T23:48:10Z","receivedAt":"2007-02-01T23:48:10Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\n\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n stgit/stack.py |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex dbdda01..729b77e 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -408,7 +408,15 @@ class Series(StgitObject):\n         self._set_field('description', line)\n \n     def get_parent_remote(self):\n-        return config.get('branch.%s.remote' % self.__name) or 'origin'\n+        value = config.get('branch.%s.remote' % self.__name)\n+        if value:\n+            return value\n+        elif 'origin' in git.remotes_list():\n+            # FIXME: this is for compatibility only.  Should be\n+            # dropped when all relevant commands record this info.\n+            return 'origin'\n+        else:\n+            raise StackException, 'Cannot find a parent remote for \"%s\"' % self.__name\n \n     def __set_parent_remote(self, remote):\n         value = config.set('branch.%s.remote' % self.__name, remote)\n@@ -418,6 +426,8 @@ class Series(StgitObject):\n         if value:\n             return value\n         elif git.rev_parse('heads/origin'):\n+            # FIXME: this is for compatibility only.  Should be\n+            # dropped when all relevant commands record this info.\n             return 'heads/origin'\n         else:\n             raise StackException, 'Cannot find a parent branch for \"%s\"' % self.__name\n"},{"id":"33365","messageId":"b0943d9e0702020158o1a07b8efu9302794c57d050e1@mail.gmail.com","threadId":"6619","inReplyTo":"20070201234805.3313.20525.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-02-02T09:58:06Z","receivedAt":"2007-02-02T09:58:06Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 01/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> Previously we were just assuming that the remote from which we\n> just failed defined a local branch whose name was the same as the\n> remote def, and that this branch was the parent.  While this is true\n> for the most common case (branch \"origin\" from remote \"origin\"), it is\n> quite an unflexible assumption.\n\nThe t1200-push-modified.sh test fails after applying this patch. It\nlooks like the 3rd test fails to pull the changes from 'foo' into\n'bar'.\n\nThanks.\n\n-- \nCatalin\n"},{"id":"33401","messageId":"20070202180706.GE5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"b0943d9e0702020158o1a07b8efu9302794c57d050e1@mail.gmail.com","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-02T18:07:06Z","receivedAt":"2007-02-02T18:07:06Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, Feb 02, 2007 at 09:58:06AM +0000, Catalin Marinas wrote:\n> On 01/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> >Previously we were just assuming that the remote from which we\n> >just failed defined a local branch whose name was the same as the\n> >remote def, and that this branch was the parent.  While this is true\n> >for the most common case (branch \"origin\" from remote \"origin\"), it is\n> >quite an unflexible assumption.\n> \n> The t1200-push-modified.sh test fails after applying this patch. It\n> looks like the 3rd test fails to pull the changes from 'foo' into\n> 'bar'.\n\nStrange, it passes here, even after pulling you latest commits\n(HEAD=fba895f5f12a652c248b0fd02b7c41f8342cfbdc).\n\nBest regards,\n-- \nYann.\n"},{"id":"33416","messageId":"20070202224250.GF5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"20070202180706.GE5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-02T22:42:50Z","receivedAt":"2007-02-02T22:42:50Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, Feb 02, 2007 at 07:07:06PM +0100, Yann Dirson wrote:\n> > The t1200-push-modified.sh test fails after applying this patch. It\n> > looks like the 3rd test fails to pull the changes from 'foo' into\n> > 'bar'.\n> \n> Strange, it passes here, even after pulling you latest commits\n> (HEAD=fba895f5f12a652c248b0fd02b7c41f8342cfbdc).\n\nWondering which GIT version you are using, I tried to run the\ntestsuite with current GIT HEAD, and it fails much earlier (t1001).\nWe'll have some work here :)\n\nBest regards,\n-- \nYann.\n"},{"id":"33419","messageId":"b0943d9e0702021501g2cb9bb6cocae0d706c8742868@mail.gmail.com","threadId":"6619","inReplyTo":"20070202224250.GF5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-02-02T23:01:59Z","receivedAt":"2007-02-02T23:01:59Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 02/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> On Fri, Feb 02, 2007 at 07:07:06PM +0100, Yann Dirson wrote:\n> > > The t1200-push-modified.sh test fails after applying this patch. It\n> > > looks like the 3rd test fails to pull the changes from 'foo' into\n> > > 'bar'.\n> >\n> > Strange, it passes here, even after pulling you latest commits\n> > (HEAD=fba895f5f12a652c248b0fd02b7c41f8342cfbdc).\n>\n> Wondering which GIT version you are using, I tried to run the\n> testsuite with current GIT HEAD, and it fails much earlier (t1001).\n> We'll have some work here :)\n\nI tried the latest GIT and it only fails at t1200. I think I got a\nt1001 failure but I fixed it. Do you want me to push the snapshot I\nhave and you can see whether it fails on your system? I tried it with\nboth Python 2.4 and 2.3 but what's strange is that 'pull' run manually\n(not from the test script) seems to work.\n\n-- \nCatalin\n"},{"id":"33421","messageId":"b0943d9e0702021525o2379883aqaf27f874134668c5@mail.gmail.com","threadId":"6619","inReplyTo":"b0943d9e0702021501g2cb9bb6cocae0d706c8742868@mail.gmail.com","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-02-02T23:25:28Z","receivedAt":"2007-02-02T23:25:28Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 02/02/07, Catalin Marinas <catalin.marinas@gmail.com> wrote:\n> I tried the latest GIT and it only fails at t1200. I think I got a\n> t1001 failure but I fixed it. Do you want me to push the snapshot I\n> have and you can see whether it fails on your system? I tried it with\n> both Python 2.4 and 2.3 but what's strange is that 'pull' run manually\n> (not from the test script) seems to work.\n\nOK, tried again and 'stg pull' doesn't update the base with the last\npatch in the series ('stg rebase origin' updates it). I don't have\nanything set up in my gitconfig in this area.\n\nI already committed the patches I have (and pushed them to the public\nrepo) so that we know whether you have additional changes.\n\nThanks.\n\n-- \nCatalin\n"},{"id":"33422","messageId":"20070202235655.GG5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"20070202180706.GE5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".)","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-02T23:56:55Z","receivedAt":"2007-02-02T23:56:55Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, Feb 02, 2007 at 07:07:06PM +0100, Yann Dirson wrote:\n> On Fri, Feb 02, 2007 at 09:58:06AM +0000, Catalin Marinas wrote:\n> > On 01/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> > >Previously we were just assuming that the remote from which we\n> > >just failed defined a local branch whose name was the same as the\n> > >remote def, and that this branch was the parent.  While this is true\n> > >for the most common case (branch \"origin\" from remote \"origin\"), it is\n> > >quite an unflexible assumption.\n> > \n> > The t1200-push-modified.sh test fails after applying this patch. It\n> > looks like the 3rd test fails to pull the changes from 'foo' into\n> > 'bar'.\n\nWith current GIT HEAD, plain git-clone creates the following config\n(when cloning a repo with HEAD pointing to branch \"downstream\":\n\n\n[remote \"origin\"]\n        url = /export/work/yann/git/stgit/tmp/.git\n        fetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"downstream\"]\n        remote = origin\n        merge = refs/heads/downstream\n                ^^^^^^^^^^^^^^^^^^^^^\n\nI would have expected \"merge = remotes/origin/downstream\" instead, and\nthis setting confuses the rebase-after-pull logic, causing it to\nrebase the stack onto its own base (no-op).\n\nIsn't that a git-clone bug ?\n\nNow, it looks like without this patch, the post-fetch rebasing only\nworked by chance, even more than I thought.\n\nBest regards, \n-- \nYann.\n"},{"id":"33424","messageId":"20070203001430.GH5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"20070202235655.GG5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".)","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-03T00:14:30Z","receivedAt":"2007-02-03T00:14:30Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Sat, Feb 03, 2007 at 12:56:55AM +0100, Yann Dirson wrote:\n> With current GIT HEAD, plain git-clone creates the following config\n> (when cloning a repo with HEAD pointing to branch \"downstream\":\n> \n> \n> [remote \"origin\"]\n>         url = /export/work/yann/git/stgit/tmp/.git\n>         fetch = +refs/heads/*:refs/remotes/origin/*\n> [branch \"downstream\"]\n>         remote = origin\n>         merge = refs/heads/downstream\n>                 ^^^^^^^^^^^^^^^^^^^^^\n> \n> I would have expected \"merge = remotes/origin/downstream\" instead, and\n> this setting confuses the rebase-after-pull logic, causing it to\n> rebase the stack onto its own base (no-op).\n\nHm, I see I was confused about the branch.*.merge meaning.  The config\ndoc does document it to be the remote part of the refspec.\n\nBut what does that mean - why using the remote part here ?  I cannot\nsee that, although I can see arguments why using the local part here:\n\n- When we come to finding the branch to merge, we have already fetched\nall remote branches into local ones, so why would we need to find a\nlocal branch matching this remote name ?\n\n- How are we supposed to handle the case where a single remote ref is\nmapped to several local ones ?  Although I cannot see a use for this\nsituation, it would seem to be a valid one, whereas having several\nfetch lines for a single local ref in a single remote would clearly\nbe invalid: using a local ref would avoid a possible ambiguity.\n\nBest regards,\n-- \nYann.\n"},{"id":"33425","messageId":"eq0k8q$rih$1@sea.gmane.org","threadId":"6619","inReplyTo":"20070202235655.GG5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-03T00:17:51Z","receivedAt":"2007-02-03T00:17:51Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Yann Dirson wrote:\n\n> With current GIT HEAD, plain git-clone creates the following config\n> (when cloning a repo with HEAD pointing to branch \"downstream\":\n> \n> \n> [remote \"origin\"]\n>         url = /export/work/yann/git/stgit/tmp/.git\n>         fetch = +refs/heads/*:refs/remotes/origin/*\n> [branch \"downstream\"]\n>         remote = origin\n>         merge = refs/heads/downstream\n>                 ^^^^^^^^^^^^^^^^^^^^^\n> \n> I would have expected \"merge = remotes/origin/downstream\" instead, and\n> this setting confuses the rebase-after-pull logic, causing it to\n> rebase the stack onto its own base (no-op).\n> \n> Isn't that a git-clone bug ?\n\nNo, it is a feature. branch.<name>.merge is usually _remote_ head,\nto allow pulling without local tracking branch. IIRC there was\npatch to allow to use local head, if it is ambiguous.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"33444","messageId":"b0943d9e0702030416t4088e7e1yaf2ac0a4c30def8d@mail.gmail.com","threadId":"6619","inReplyTo":"20070202235655.GG5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".)","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-02-03T12:16:47Z","receivedAt":"2007-02-03T12:16:47Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"Yann,\n\nOn 02/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> On Fri, Feb 02, 2007 at 07:07:06PM +0100, Yann Dirson wrote:\n> > On Fri, Feb 02, 2007 at 09:58:06AM +0000, Catalin Marinas wrote:\n> > > On 01/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> > > >Previously we were just assuming that the remote from which we\n> > > >just failed defined a local branch whose name was the same as the\n> > > >remote def, and that this branch was the parent.  While this is true\n> > > >for the most common case (branch \"origin\" from remote \"origin\"), it is\n> > > >quite an unflexible assumption.\n> > >\n> > > The t1200-push-modified.sh test fails after applying this patch. It\n> > > looks like the 3rd test fails to pull the changes from 'foo' into\n> > > 'bar'.\n>\n> With current GIT HEAD, plain git-clone creates the following config\n> (when cloning a repo with HEAD pointing to branch \"downstream\":\n\nAs I haven't followed the GIT latest developments in this area, I\ncan't comment. Regarding StGIT, I'd like it to work with earlier\nstable versions of GIT and not just with the current HEAD. I (and\nprobably many others) already have repositories cloned some (long)\ntime ago and their gitconfig might not have the cloning information.\n\nThe (interim) solution I see is for StGIT pull command to default to\nusing git-pull and people can configure it to git-fetch and the\nautomatic rebase if they need it. I'd like to release 0.12 this\nweekend but 'pull' doesn't currently work. Are you OK with my solution\n(for backward compatibility with older repositories and GIT versions)?\n\nThanks.\n\n-- \nCatalin\n"},{"id":"33446","messageId":"20070203144725.GK5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"b0943d9e0702030416t4088e7e1yaf2ac0a4c30def8d@mail.gmail.com","subject":"Re: git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".)","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-03T14:47:25Z","receivedAt":"2007-02-03T14:47:25Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Sat, Feb 03, 2007 at 12:16:47PM +0000, Catalin Marinas wrote:\n> Yann,\n> \n> On 02/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> >On Fri, Feb 02, 2007 at 07:07:06PM +0100, Yann Dirson wrote:\n> >> On Fri, Feb 02, 2007 at 09:58:06AM +0000, Catalin Marinas wrote:\n> >> > On 01/02/07, Yann Dirson <ydirson@altern.org> wrote:\n> >> > >Previously we were just assuming that the remote from which we\n> >> > >just failed defined a local branch whose name was the same as the\n> >> > >remote def, and that this branch was the parent.  While this is true\n> >> > >for the most common case (branch \"origin\" from remote \"origin\"), it is\n> >> > >quite an unflexible assumption.\n> >> >\n> >> > The t1200-push-modified.sh test fails after applying this patch. It\n> >> > looks like the 3rd test fails to pull the changes from 'foo' into\n> >> > 'bar'.\n> >\n> >With current GIT HEAD, plain git-clone creates the following config\n> >(when cloning a repo with HEAD pointing to branch \"downstream\":\n> \n> As I haven't followed the GIT latest developments in this area, I\n> can't comment.\n\nAs noted elsewhere, I have misinterpreted the branch.*.merge\nparameter; I'm trying to get things right.\n\n> Regarding StGIT, I'd like it to work with earlier\n> stable versions of GIT and not just with the current HEAD. I (and\n> probably many others) already have repositories cloned some (long)\n> time ago and their gitconfig might not have the cloning information.\n\nThere are 2 issues there:\n\n- support for running atop previous releases of Git. For this we\nshould select a policy like \"we support the current stable branch (or\nto-be-published, like 1.5.0), and the previous (ie. 1.4.4.x or\n1.4.x)\", and document that in the release notes so packagers can\nupdate their dependencies.\n\n- and continue to work with repos created with old releases.  For the\n\"pull\" change, what's needed (or should be, modulo bugs such as this\none), is to tell people they need to \"git config\" the missing info\nwhen it's not there.  I have tried to keep the old behaviour as much\nas possible (ie. relying on the user to pass the info on command-line)\ninstead of insisting on the user providing the info in the config\nfile, but this work is probably not 100% finished.\n\n\n> The (interim) solution I see is for StGIT pull command to default to\n> using git-pull and people can configure it to git-fetch and the\n> automatic rebase if they need it. I'd like to release 0.12 this\n> weekend but\n\nRight, it is reasonable to keep the old behaviour the default for now.\n\n\n> 'pull' doesn't currently work.\n\nI'll still try to make it work nevertheless before the release :)\n\nBest regards,\n-- \nYann.\n"},{"id":"33492","messageId":"20070203214619.GM5362@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"b0943d9e0702021525o2379883aqaf27f874134668c5@mail.gmail.com","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-03T21:46:19Z","receivedAt":"2007-02-03T21:46:19Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Fri, Feb 02, 2007 at 11:25:28PM +0000, Catalin Marinas wrote:\n> OK, tried again and 'stg pull' doesn't update the base with the last\n> patch in the series ('stg rebase origin' updates it). I don't have\n> anything set up in my gitconfig in this area.\n\nSo now that this particular problem has a fix, let's fix everything\nrelated.\n\nSince branch.*.merge accept local ref names, there is probably far\nmore to change that what I initially feared.\n\n1. I guess we can continue to store local refs for those branches when\nthey mirror a remote one, but if we store something there without\nstoring a branch.*.remote to '.', git-fetch could confuse this local\nref with a ref from remote 'origin', since that's still the default.\n\n2. branch.*.merge is not where we should read a parent branch from.\nEven if we store that info there, the user could have put a remote ref\nname there.  So if we want to keep a get_parent_branch() method we'll\nhave to store that info somewhere else, eg. branch.*.stgit.parentbranch.\n\n3. we need get_parent_branch() to implement parent branch as default\narg to \"stg rebase\"\n\nSo (please correct me if necessary):\n\n- always store local parent branch to branch.*.stgit.parentbranch\n- never set branch.*.merge without setting branch.*.remote\n- set them, with remote as '.' when dealing with local branch\n\nBest regards,\n-- \nYann.\n"},{"id":"33499","messageId":"7v8xfe3kwo.fsf@assigned-by-dhcp.cox.net","threadId":"6619","inReplyTo":"20070203214619.GM5362@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-03T23:01:59Z","receivedAt":"2007-02-03T23:01:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> On Fri, Feb 02, 2007 at 11:25:28PM +0000, Catalin Marinas wrote:\n>> OK, tried again and 'stg pull' doesn't update the base with the last\n>> patch in the series ('stg rebase origin' updates it). I don't have\n>> anything set up in my gitconfig in this area.\n>\n> So now that this particular problem has a fix, let's fix everything\n> related.\n>\n> Since branch.*.merge accept local ref names, there is probably far\n> more to change that what I initially feared.\n\nIf that is the case maybe we should fix branch.*.merge not to\nmatch the local tracking branch name.  Matching it with local\ntracking branch name when the remote name does not match was\nwerely a fallback to help broken configurations confused people\nmight create by hand, and has never been the part of sane\npractice at all.\n"},{"id":"33502","messageId":"7v8xfe22k5.fsf@assigned-by-dhcp.cox.net","threadId":"6619","inReplyTo":"7v8xfe3kwo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-04T00:23:38Z","receivedAt":"2007-02-04T00:23:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Yann Dirson <ydirson@altern.org> writes:\n> ...\n>> Since branch.*.merge accept local ref names, there is probably far\n>> more to change that what I initially feared.\n>\n> If that is the case maybe we should fix branch.*.merge not to\n> match the local tracking branch name.  Matching it with local\n> tracking branch name when the remote name does not match was\n> werely a fallback to help broken configurations confused people\n> might create by hand, and has never been the part of sane\n> practice at all.\n\nThat is, I suspect that reverting 80c79776 would make things a\nlot more consistent.\n\n-- >8 --\n[PATCH] Revert \"Allow branch.*.merge to talk about remote tracking branches.\"\n\nThis reverts commit 80c797764a6b6a373f0f1f47d7f56b0d950418a9.\n\nBack when I committed this, it seemed to be a good idea.  People\nwho always use remote tracking branches can optionally use the\nlocal name they happen to use to specify what to merge, which meant\nthat I did not have to teach them why we use the name at the remote\nside every time they are confused.\n\nBut allowing it seems to break other people's scripts.  The real\nsolution is not to allow more ways to express the same thing, but\nto educate people to use the right syntax.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n git-parse-remote.sh |    8 ++------\n 1 files changed, 2 insertions(+), 6 deletions(-)\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 3e783b7..5208ee6 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -174,12 +174,8 @@ canon_refs_list_for_fetch () {\n \t\telse\n \t\t\tfor merge_branch in $merge_branches\n \t\t\tdo\n-\t\t\t    if\ttest \"$remote\" = \"$merge_branch\" ||\n-\t\t\t\ttest \"$local\" = \"$merge_branch\"\n-\t\t\t    then\n-\t\t\t\t    dot_prefix=\n-\t\t\t\t    break\n-\t\t\t    fi\n+\t\t\t    [ \"$remote\" = \"$merge_branch\" ] &&\n+\t\t\t    dot_prefix= && break\n \t\t\tdone\n \t\tfi\n \t\tcase \"$remote\" in\n-- \n1.5.0.rc3.24.g2391\n"},{"id":"33503","messageId":"20070204002439.GH4266@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6619","inReplyTo":"7v8xfe3kwo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-04T00:24:39Z","receivedAt":"2007-02-04T00:24:39Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Sat, Feb 03, 2007 at 03:01:59PM -0800, Junio C Hamano wrote:\n> Yann Dirson <ydirson@altern.org> writes:\n> \n> > On Fri, Feb 02, 2007 at 11:25:28PM +0000, Catalin Marinas wrote:\n> >> OK, tried again and 'stg pull' doesn't update the base with the last\n> >> patch in the series ('stg rebase origin' updates it). I don't have\n> >> anything set up in my gitconfig in this area.\n> >\n> > So now that this particular problem has a fix, let's fix everything\n> > related.\n> >\n> > Since branch.*.merge accept local ref names, there is probably far\n> > more to change that what I initially feared.\n> \n> If that is the case maybe we should fix branch.*.merge not to\n> match the local tracking branch name.  Matching it with local\n> tracking branch name when the remote name does not match was\n> werely a fallback to help broken configurations confused people\n> might create by hand, and has never been the part of sane\n> practice at all.\n\nOh, sorry, I indeed meant \"less to change\" :>\n\nSince git-fetch alone makes the decisions (so no algorithm has to get\nduplicated into stgit), and since the only remote refs possibly\nconfused for local ones are the old non-separate ones, and since in\nthat case usually the remote branches are mapped to the same name, the\nodds for a problem are low, and will get lower.\n\nMaking branch.*.merge not understand local refs, OTOH, would require\nstgit to resolve a local branch to its remote name.  Note that I\nalready had to do the job to guess which remote a branch was pulled\nfrom (and thus, to decide whether a branch was local or remote).\n\nFortunately, all of this is going to be unnecessary on newer repos\nsince git-clone now fills all the fields - we only have to deal with\nthe upgrade of older repos.\n\nBest regards,\n-- \nYann.\n"},{"id":"33516","messageId":"20070204014945.GA18357@coredump.intra.peff.net","threadId":"6619","inReplyTo":"7v8xfe3kwo.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-02-04T01:49:45Z","receivedAt":"2007-02-04T01:49:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 03, 2007 at 03:01:59PM -0800, Junio C Hamano wrote:\n\n> > Since branch.*.merge accept local ref names, there is probably far\n> > more to change that what I initially feared.\n> \n> If that is the case maybe we should fix branch.*.merge not to\n> match the local tracking branch name.  Matching it with local\n> tracking branch name when the remote name does not match was\n> werely a fallback to help broken configurations confused people\n> might create by hand, and has never been the part of sane\n> practice at all.\n\nI was one of the major pushers of this feature in December; however, I\nthink it actually can create some confusing results. See:\n  http://article.gmane.org/gmane.comp.version-control.git/35789\n\nI still think it is worth pursuing, but I have been waiting for v1.5.0\nto happen before stirring up more trouble. Regardless, I think this\nimplementation is not the right way to go about it, and you should\nrevert 80c79776.\n\n-Peff\n"},{"id":"33517","messageId":"7vzm7uy8ng.fsf@assigned-by-dhcp.cox.net","threadId":"6619","inReplyTo":"20070204014945.GA18357@coredump.intra.peff.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-04T02:10:59Z","receivedAt":"2007-02-04T02:10:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I was one of the major pushers of this feature in December; however, I\n> think it actually can create some confusing results. See:\n>   http://article.gmane.org/gmane.comp.version-control.git/35789\n\nI actually was re-reading that exact post (and more importantly,\nmessages 35810 and 36374 in the thread) before I sent the\nmessage you are replying to.\n\nWhile I think branch.*.merge, which was invented for the use of\ngit-pull -> git-merge callchain, should consistently use the\nremote branch name, after re-reading your messages, especially\n36374, I see why you wanted a mechanism to talk about\nrelationships between two (or more) local branches.\n\nI do not think it is wrong to have a separate mechanism (and it\nmight end up being called as \"mergelocal\" which you said might\nbe a terrible name) for that.  I just think it is probably a\nwrong thing to do to use branch.*.merge for that. As you said,\noperations you are interested in like format-patch (and perhaps\nrebase) of a local branch relative to another locally available\nref (be it another branch or a tracking branch) do not involve\nfetching (hence pulling) necessarily.\n"},{"id":"33518","messageId":"20070204023818.GA27644@coredump.intra.peff.net","threadId":"6619","inReplyTo":"7vzm7uy8ng.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] Rebase to parent branch after git-fetch in \"stg pull\".","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-02-04T02:38:18Z","receivedAt":"2007-02-04T02:38:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 03, 2007 at 06:10:59PM -0800, Junio C Hamano wrote:\n\n> I do not think it is wrong to have a separate mechanism (and it\n> might end up being called as \"mergelocal\" which you said might\n> be a terrible name) for that.  I just think it is probably a\n> wrong thing to do to use branch.*.merge for that. As you said,\n> operations you are interested in like format-patch (and perhaps\n> rebase) of a local branch relative to another locally available\n> ref (be it another branch or a tracking branch) do not involve\n> fetching (hence pulling) necessarily.\n\nGood, it looks like we are mostly agreeing on this then (the feature\nmight have some use, but it should _not_ be tacked onto branch.*.merge).\nI will give it some thought until v1.5.0 has settled, and then hopefully\nsubmit some patches.\n\n-Peff\n"}]}