threads / patch / 7984

patchAvoid contrib/stg-swallow deleting unrelated empty patches.

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

## tl;dr

One message between May 5, 2007 and May 5, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Yann Dirson· May 5, 2007, 13:58 UTC · lore

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(-)
Show changes to contrib/stg-swallow +5 −1
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"

← back to recent threads