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

[PATCH] Display (empty) when appropriate for the goto command

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Nov 23, 2008, 21:23 UTC
Message-ID
<20081123212318.9835.53505.stgit@localhost.localdomain>

This is a fix for bug #11810. The original implementation of goto used to display (empty patch) when a patch became empty during a push + merge operation. This patch adds this feature again.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
 stgit/lib/transaction.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py
index de62a8c..6623645 100644
--- a/stgit/lib/transaction.py
+++ b/stgit/lib/transaction.py
@@ -290,7 +290,6 @@ class StackTransaction(object):
         conflicts to them."""
         orig_cd = self.patches[pn].data
         cd = orig_cd.set_committer(None)
-        s = ['', ' (empty)'][cd.is_nochange()]
         oldparent = cd.parent
         cd = cd.set_parent(self.top)
         base = oldparent.data.tree
@@ -298,6 +297,7 @@ class StackTransaction(object):
         theirs = cd.tree
         tree, self.temp_index_tree = self.temp_index.merge(
             base, ours, theirs, self.temp_index_tree)
+        s = ''
         merge_conflict = False
         if not tree:
             if iw == None:
@@ -324,6 +324,8 @@ class StackTransaction(object):
         else:
             comm = None
             s = ' (unmodified)'
+        if not merge_conflict and cd.is_nochange():
+            s = ' (empty)'
         out.info('Pushed %s%s' % (pn, s))
         def update():
             if comm:
Next: Karl Hasselström
Message 1 of 2 in “Display (empty) when appropriate for the goto command”
  1. Display (empty) when appropriate for the goto commandCatalin Marinas, Nov 23, 2008
  2. Karl HasselströmNov 24, 2008

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.