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

[PATCH 1/2] Parse /top.old with id and when requesting diffs

From
PGPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Date
Oct 27, 2005, 08:56 UTC
Message-ID
<20051027085622.2482.22005.stgit@zion.home.lan>
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Comparing a patch after and before a merge is very important, and looking into .git/patches by hand is not the nicer way to do it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
 stgit/commands/common.py |    5 +++++
 stgit/stack.py           |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/stgit/commands/common.py b/stgit/commands/common.py
--- a/stgit/commands/common.py
+++ b/stgit/commands/common.py
@@ -68,6 +68,11 @@ def git_id(string):
             return series.get_patch(patch_name).get_top()
         elif patch_id == 'bottom':
             return series.get_patch(patch_name).get_bottom()
+        # Note we can return None here.
+        elif patch_id == 'top.old':
+            return series.get_patch(patch_name).get_old_top()
+        elif patch_id == 'bottom.old':
+            return series.get_patch(patch_name).get_old_bottom()
 
     # base
     if patch_name == 'base' and len(string_list) == 1:
diff --git a/stgit/stack.py b/stgit/stack.py
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -165,6 +165,9 @@ class Patch:
         elif os.path.isfile(fname):
             os.remove(fname)
 
+    def get_old_bottom(self):
+        return self.__get_field('bottom.old')
+
     def get_bottom(self):
         return self.__get_field('bottom')
 
@@ -177,6 +180,9 @@ class Patch:
                 self.__set_field('bottom.old', None)
         self.__set_field('bottom', string)
 
+    def get_old_top(self):
+        return self.__get_field('top.old')
+
     def get_top(self):
         return self.__get_field('top')
 
Next: Paolo 'Blaisorblade' Giarrusso
Message 1 of 2 in “Parse /top.old with id and when requesting diffs”
  1. 1/2 Parse /top.old with id and when requesting diffsPaolo 'Blaisorblade' Giarrusso, Oct 27, 2005
  2. 2/2 Ask vim to avoid backup copies of .stgit.msgPaolo 'Blaisorblade' Giarrusso, Oct 27, 2005

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.