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

[PATCH] Check git pull remote before defaulting to 'origin'

From
PRPavel Roskin <proski@gnu.org>
Date
Jan 9, 2007, 07:20 UTC
Message-ID
<1168327205.7890.2.camel@dv>
In-Reply-To
<b0943d9e0612100841h7d064c7cs37f882f91e3eddf8@mail.gmail.com>
Check git pull remote before defaulting to 'origin'
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 stgit/commands/pull.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/stgit/commands/pull.py b/stgit/commands/pull.py
index 227249e..7c5db22 100644
--- a/stgit/commands/pull.py
+++ b/stgit/commands/pull.py
@@ -50,10 +50,16 @@ def func(parser, options, args):
     if len(args) > 2:
         parser.error('incorrect number of arguments')
 
-    repository = 'origin'
-    refspec = None
     if len(args) >= 1:
         repository = args[0]
+    else:
+        section = 'branch "%s"' % git.get_head_file()
+        if config.has_option(section, 'remote'):
+            repository = config.get(section, 'remote')
+        else:
+            repository = 'origin'
+
+    refspec = None
     if len(args) == 2:
         refspec = args[1]
 
-- 
Regards,
Pavel Roskin
Previous: Catalin MarinasNext: Catalin Marinas
Message 2 of 3 in “Re: RFC PATCH: support for default remote in StGIT”
  1. Catalin MarinasDec 10, 2006
  2. Check git pull remote before defaulting to 'origin'Pavel Roskin, Jan 9, 2007
  3. Catalin MarinasJan 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.