Git development
 help / color / mirror / Atom feed
* [StGIT PATCH] Avoid contrib/stg-swallow deleting unrelated empty patches.
@ 2007-05-05 13:58 Yann Dirson
  0 siblings, 0 replies; only message in thread
From: Yann Dirson @ 2007-05-05 13:58 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git


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"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-05 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-05 13:58 [StGIT PATCH] Avoid contrib/stg-swallow deleting unrelated empty patches Yann Dirson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox