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

[StGit PATCH 1/2] Test that stg coalesce handles head != top gracefully

From
Karl Hasselström <kha@treskal.com>
Date
Aug 27, 2008, 22:06 UTC
Message-ID
<20080827220649.3607.89509.stgit@yoghurt>
In-Reply-To
<20080827220606.3607.17134.stgit@yoghurt>

It currently doesn't quite: it will roll back the transaction just fine, but not before asking the user for a commit message which is lost in the rollback.

Bug discovered by Erik Sandberg <mandolaerik@gmail.com>: https://gna.org/bugs/?12204

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t2600-coalesce.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/t/t2600-coalesce.sh b/t/t2600-coalesce.sh
index ef5bf99..33c073d 100755
--- a/t/t2600-coalesce.sh
+++ b/t/t2600-coalesce.sh
@@ -28,4 +28,17 @@ test_expect_success 'Coalesce at stack top' '
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ]
 '
 
+cat > editor <<EOF
+#!/bin/sh
+echo "Editor was invoked" | tee editor-invoked
+EOF
+chmod a+x editor
+test_expect_failure 'Coalesce with top != head' '
+    echo blahonga >> foo.txt &&
+    git commit -a -m "a new commit" &&
+    EDITOR=./editor command_error stg coalesce --name=r0 p0 q1 &&
+    test "$(echo $(stg series))" = "+ p0 > q1" &&
+    test ! -e editor-invoked
+'
+
 test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 4 in “Fix bug 12204”
  1. 0/2 Fix bug 12204Karl Hasselström, Aug 27, 2008
  2. 1/2 Test that stg coalesce handles head != top gracefullyKarl Hasselström, Aug 27, 2008
  3. 2/2 Check for top == head at the start of every transactionKarl Hasselström, Aug 27, 2008
  4. Catalin MarinasAug 30, 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.