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

[PATCH 3/7] Move identification of parent branch's remote def up into stack class.

From
Yann Dirson <ydirson@altern.org>
Date
Jan 29, 2007, 23:05 UTC
Message-ID
<20070129230535.7102.54749.stgit@gandelf.nowhere.earth>
In-Reply-To
<20070129230117.7102.64322.stgit@gandelf.nowhere.earth>

Also adds the __set_parent_remote() counterpart method, but only private since it is expected to be called only through set_parent, to be introduced in subsequent patch.

Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 stgit/commands/pull.py |    2 +-
 stgit/stack.py         |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/stgit/commands/pull.py b/stgit/commands/pull.py
index e47858a..0608fb6 100644
--- a/stgit/commands/pull.py
+++ b/stgit/commands/pull.py
@@ -53,7 +53,7 @@ def func(parser, options, args):
     if len(args) >= 1:
         repository = args[0]
     else:
-        repository = config.get('branch.%s.remote' % git.get_head_file()) or 'origin'
+        repository = crt_series.get_parent_remote()
 
     refspec = None
     if len(args) == 2:
diff --git a/stgit/stack.py b/stgit/stack.py
index 6281f36..947b416 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -407,6 +407,12 @@ class Series(StgitObject):
     def set_description(self, line):
         self._set_field('description', line)
 
+    def get_parent_remote(self):
+        return config.get('branch.%s.remote' % self.__name) or 'origin'
+
+    def __set_parent_remote(self, remote):
+        value = config.set('branch.%s.remote' % self.__name, remote)
+
     def __patch_is_current(self, patch):
         return patch.get_name() == self.get_current()
 
Previous: Yann DirsonNext: Yann Dirson
Message 4 of 10 in “StGIT, remotes, and parent”
  1. 0/7 StGIT, remotes, and parentYann Dirson, Jan 29, 2007
  2. 1/7 Make stgit.config use git-repo-config.Yann Dirson, Jan 29, 2007
  3. 2/7 Add caching to the new config class.Yann Dirson, Jan 29, 2007
  4. 3/7 Move identification of parent branch's remote def up into stack class.Yann Dirson, Jan 29, 2007
  5. 4/7 Allows extraction of information about remotes.Yann Dirson, Jan 29, 2007
  6. 5/7 Basic support for keeping a ref to the parent branch.Yann Dirson, Jan 29, 2007
  7. 6/7 Have 'stg branch --create' record parent information.Yann Dirson, Jan 29, 2007
  8. 7/7 Make 'stg pull' use git-fetch and not git-pull.Yann Dirson, Jan 29, 2007
  9. Catalin MarinasJan 31, 2007
  10. Yann DirsonFeb 1, 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.