All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: "Karl Hasselström" <kha@treskal.com>,
	"Catalin Marinas" <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: stg clean removes conflicting patch
Date: Thu, 24 Jan 2008 22:55:17 -0500	[thread overview]
Message-ID: <1201233317.2811.17.camel@dv> (raw)

Hello!

If "stg push" fails, the subsequent "stg clean" will remove the patch
that could not been applied.  I think it's wrong.  Especially when doing
"stg pull", it can happen that I want to run "stg clean" to get rid of
the patches applied upstream so I can concentrate on the conflict.
Instead, the conflicting patch is removed too.

I've made a patch for the testsuite that should pass once the bug is
fixed.  Try removing "stg clean" from the test. and it will pass.  But
"stg clean" should make no difference here.

Add test to ensure that "stg clean" preserves conflicting patches

From: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 t/t2500-clean.sh |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)


diff --git a/t/t2500-clean.sh b/t/t2500-clean.sh
index 3364c18..ad8f892 100755
--- a/t/t2500-clean.sh
+++ b/t/t2500-clean.sh
@@ -24,4 +24,21 @@ test_expect_success 'Clean empty patches' '
     [ "$(echo $(stg unapplied))" = "" ]
 '
 
+test_expect_success 'Create a conflict' '
+    stg new p1 -m p1 &&
+    echo bar > foo.txt &&
+    stg refresh &&
+    stg pop &&
+    stg new p2 -m p2
+    echo quux > foo.txt &&
+    stg refresh &&
+    ! stg push
+'
+
+test_expect_success 'Make sure conflicting patches are preserved' '
+    stg clean &&
+    [ "$(echo $(stg applied))" = "p0 p2 p1" ] &&
+    [ "$(echo $(stg unapplied))" = "" ]
+'
+
 test_done


-- 
Regards,
Pavel Roskin

             reply	other threads:[~2008-01-25  3:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25  3:55 Pavel Roskin [this message]
2008-01-25  8:04 ` stg clean removes conflicting patch Karl Hasselström
2008-01-25  8:40   ` Pavel Roskin
2008-01-25  9:53   ` Catalin Marinas
2008-01-25 10:17     ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1201233317.2811.17.camel@dv \
    --to=proski@gnu.org \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.