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

stg clean removes conflicting patch

From
PRPavel Roskin <proski@gnu.org>
Date
Jan 25, 2008, 03:55 UTC
Message-ID
<1201233317.2811.17.camel@dv>
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
Next: Karl Hasselström
Message 1 of 5 in “stg clean removes conflicting patch”
  1. Pavel RoskinJan 25, 2008
  2. Karl HasselströmJan 25, 2008
  3. Pavel RoskinJan 25, 2008
  4. Catalin MarinasJan 25, 2008
  5. Karl HasselströmJan 25, 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.