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

[StGIT PATCH] Avoid contrib/stg-swallow deleting unrelated empty patches.

From
Yann Dirson <ydirson@altern.org>
Date
May 5, 2007, 13:58 UTC
Message-ID
<20070505135757.5142.90536.stgit@gandelf.nowhere.earth>

Let's just check ourselves if the patch is empty after pushing instead of using clean: no more surprise with patches getting abusively cleaned, and we should now be faster when there are many unapplied patches.

Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 contrib/stg-swallow |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/contrib/stg-swallow b/contrib/stg-swallow
index 5014f39..924c079 100755
--- a/contrib/stg-swallow
+++ b/contrib/stg-swallow
@@ -15,5 +15,9 @@ patch="$1"
 stg pick --fold "$patch"
 stg refresh
 stg push "$patch"
+
 #stg clean "$patch"
-stg pop; stg clean -u
+#stg pop; stg clean -u
+[ $(stg id "$patch//top") != $(stg id "$patch//bottom") ] ||
+    { echo >&2 "Assertion failed: patch '$patch' is not empty after swallowing, not deleting it."; exit 1; }    
+stg delete "$patch"
Message 1 of 1 in “Avoid contrib/stg-swallow deleting unrelated empty patches.”
  1. Avoid contrib/stg-swallow deleting unrelated empty patches.Yann Dirson, May 5, 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.