{"thread":{"id":"6298","subject":"[PATCH] Check git pull remote before defaulting to 'origin'","startedAt":"2006-12-10T16:41:10Z","lastAt":"2007-01-09T10:30:49Z","messageCount":3,"participants":["Pavel Roskin","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"294765","messageId":"b0943d9e0612100841h7d064c7cs37f882f91e3eddf8@mail.gmail.com","threadId":"6298","inReplyTo":"1165657360.2816.61.camel@portland.localdomain","subject":"Re: RFC PATCH: support for default remote in StGIT","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2006-12-10T16:41:10Z","receivedAt":"2006-12-10T16:41:10Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 09/12/06, Pavel Roskin <proski@gnu.org> wrote:\n> Sorry, I was unlucky to pick your address from setup.py, where it's\n> incorrect (gmail.org, not gmail.com), so I'm sending you another copy.\n\nThanks for spotting this.\n\n> One approach is to leave the default remote selection completely to git.\n> The downside is that StGIT prints the remote it's pulling from.  Now\n> StGIT will have to print common words that it's pulling something.  Or\n> maybe it shouldn't print anything?\n\nYann started a thread on this but I didn't find the time to look at\nthis properly. He's idea was to store the remote branch information in\nthe StGIT metadata but I'd like to leave this for GIT to deal with.\n\nThe StGIT UI can probably be modified to display something useful but\nI don't see a problem if it doesn't.\n\n> The other approach is to calculate the default remote in StGIT.  This\n> would allow StGIT to tell the user where it's pulling from.\n>\n> However, I had to introduce a function that ignores errors except there\n> is any output on stderr.  This is because git-repo-config returns error\n> code 1 if it cannot find the key.  Maybe git-repo-config should have an\n> option not to fail in this case?  Perhaps a default value to return?\n\nWith the recent changes, StGIT shares the config files with GIT and it\nhas direct access to git settings without the need to use\ngit-repo-config. Just use \"config.has_key\" and \"config.get_option\".\n\nMaybe a combination of your two options - StGIT could try to get the\ndefault branch and, if there isn't any in the config files, just\ninvoke git-pull without any argument (and display something like\n\"pulling from default\").\n\n-- \n"},{"id":"31204","messageId":"1168327205.7890.2.camel@dv","threadId":"6298","inReplyTo":"b0943d9e0612100841h7d064c7cs37f882f91e3eddf8@mail.gmail.com","subject":"[PATCH] Check git pull remote before defaulting to 'origin'","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-01-09T07:20:05Z","receivedAt":"2007-01-09T07:20:05Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Check git pull remote before defaulting to 'origin'\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/commands/pull.py |   10 ++++++++--\n 1 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/pull.py b/stgit/commands/pull.py\nindex 227249e..7c5db22 100644\n--- a/stgit/commands/pull.py\n+++ b/stgit/commands/pull.py\n@@ -50,10 +50,16 @@ def func(parser, options, args):\n     if len(args) > 2:\n         parser.error('incorrect number of arguments')\n \n-    repository = 'origin'\n-    refspec = None\n     if len(args) >= 1:\n         repository = args[0]\n+    else:\n+        section = 'branch \"%s\"' % git.get_head_file()\n+        if config.has_option(section, 'remote'):\n+            repository = config.get(section, 'remote')\n+        else:\n+            repository = 'origin'\n+\n+    refspec = None\n     if len(args) == 2:\n         refspec = args[1]\n \n\n-- \nRegards,\nPavel Roskin\n"},{"id":"31224","messageId":"b0943d9e0701090230j3611784bw5c2db84576327bd1@mail.gmail.com","threadId":"6298","inReplyTo":"1168327205.7890.2.camel@dv","subject":"Re: [PATCH] Check git pull remote before defaulting to 'origin'","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-01-09T10:30:49Z","receivedAt":"2007-01-09T10:30:49Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 09/01/07, Pavel Roskin <proski@gnu.org> wrote:\n> Check git pull remote before defaulting to 'origin'\n\nThanks. Applied.\n\n-- \nCatalin\n"}]}