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

[PATCH 3/3] Do not return 'origin' as parent remote when there is no such remote.

From
Yann Dirson <ydirson@altern.org>
Date
Feb 1, 2007, 23:48 UTC
Message-ID
<20070201234810.3313.72720.stgit@gandelf.nowhere.earth>
In-Reply-To
<20070201234534.3313.10426.stgit@gandelf.nowhere.earth>
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 stgit/stack.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index dbdda01..729b77e 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -408,7 +408,15 @@ class Series(StgitObject):
         self._set_field('description', line)
 
     def get_parent_remote(self):
-        return config.get('branch.%s.remote' % self.__name) or 'origin'
+        value = config.get('branch.%s.remote' % self.__name)
+        if value:
+            return value
+        elif 'origin' in git.remotes_list():
+            # FIXME: this is for compatibility only.  Should be
+            # dropped when all relevant commands record this info.
+            return 'origin'
+        else:
+            raise StackException, 'Cannot find a parent remote for "%s"' % self.__name
 
     def __set_parent_remote(self, remote):
         value = config.set('branch.%s.remote' % self.__name, remote)
@@ -418,6 +426,8 @@ class Series(StgitObject):
         if value:
             return value
         elif git.rev_parse('heads/origin'):
+            # FIXME: this is for compatibility only.  Should be
+            # dropped when all relevant commands record this info.
             return 'heads/origin'
         else:
             raise StackException, 'Cannot find a parent branch for "%s"' % self.__name
Previous: Yann Dirson
Message 21 of 21 in “Update to stgit parent tracking”
  1. 0/3 Update to stgit parent trackingYann Dirson, Feb 1, 2007
  2. 1/3 The user does not want to mess with the refspecs.Yann Dirson, Feb 1, 2007
  3. 2/3 Rebase to parent branch after git-fetch in "stg pull".Yann Dirson, Feb 1, 2007
  4. Catalin MarinasFeb 2, 2007
  5. Yann DirsonFeb 2, 2007
  6. Yann DirsonFeb 2, 2007
  7. Catalin MarinasFeb 2, 2007
  8. Catalin MarinasFeb 2, 2007
  9. Yann DirsonFeb 3, 2007
  10. Junio C HamanoFeb 3, 2007
  11. Junio C HamanoFeb 4, 2007
  12. Yann DirsonFeb 4, 2007
  13. Jeff KingFeb 4, 2007
  14. Junio C HamanoFeb 4, 2007
  15. Jeff KingFeb 4, 2007
  16. git-clone wrongly setting branch.*.merge ? (Was: [PATCH 2/3] Rebase to parent branch after git-fetch in "stg pull".)Yann Dirson, Feb 2, 2007
  17. Yann DirsonFeb 3, 2007
  18. Jakub NarebskiFeb 3, 2007
  19. Catalin MarinasFeb 3, 2007
  20. Yann DirsonFeb 3, 2007
  21. 3/3 Do not return 'origin' as parent remote when there is no such remote.Yann Dirson, Feb 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.