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

[StGit PATCH 2/2] Test the new powers of "stg assimilate"

From
Karl Hasselström <kha@treskal.com>
Date
Sep 26, 2007, 02:15 UTC
Message-ID
<20070926021514.1202.68589.stgit@yoghurt>
In-Reply-To
<20070926020911.1202.2580.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t1302-assimilate-interop.sh |   59 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100755 t/t1302-assimilate-interop.sh
diff --git a/t/t1302-assimilate-interop.sh b/t/t1302-assimilate-interop.sh
new file mode 100755
index 0000000..31f8b78
--- /dev/null
+++ b/t/t1302-assimilate-interop.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+test_description='Test git/StGit interoperability with "stg assimilate"'
+. ./test-lib.sh
+
+test_expect_success 'Create some git-only history' '
+    echo foo > foo.txt &&
+    git add foo.txt &&
+    git commit -a -m foo &&
+    git tag foo-tag &&
+    for i in 0 1 2 3 4; do
+        echo foo$i >> foo.txt &&
+        git commit -a -m foo$i;
+    done
+'
+
+test_expect_success 'Initialize the StGit repository' '
+    stg init
+'
+
+test_expect_success 'Create five patches' '
+    for i in 0 1 2 3 4; do
+        stg new p$i -m p$i;
+    done &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] &&
+    [ "$(echo $(stg unapplied))" = "" ]
+'
+
+test_expect_success 'Pop two patches with git-reset' '
+    git reset --hard HEAD~2 &&
+    ! stg refresh &&
+    stg assimilate &&
+    stg refresh &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
+    [ "$(echo $(stg unapplied))" = "p3 p4" ]
+'
+
+test_expect_success 'Create a new patch' '
+    stg new q0 -m q0 &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2 q0" ] &&
+    [ "$(echo $(stg unapplied))" = "p3 p4" ]
+'
+
+test_expect_success 'Go to an unapplied patch with with git-reset' '
+    git reset --hard $(stg id p3) &&
+    ! stg refresh &&
+    stg assimilate &&
+    stg refresh &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2 p3" ] &&
+    [ "$(echo $(stg unapplied))" = "q0 p4" ]
+'
+
+test_expect_success 'Go back to below the stack base with git-reset' '
+    git reset --hard foo-tag &&
+    stg assimilate &&
+    [ "$(echo $(stg applied))" = "" ] &&
+    [ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 q0 p4" ]
+'
+
+test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 3 of 5 in “"stg assimilate" on steroids”
  1. 0/2 "stg assimilate" on steroidsKarl Hasselström, Sep 26, 2007
  2. 1/2 Teach "stg assimilate" to repair patch reachabilityKarl Hasselström, Sep 26, 2007
  3. 2/2 Test the new powers of "stg assimilate"Karl Hasselström, Sep 26, 2007
  4. Karl HasselströmSep 27, 2007
  5. Let "stg assimilate" handle missing patchesKarl Hasselström, Sep 27, 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.