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

[StGit PATCH 3/6] Try uncommitting a commit with not exactly one parent

From
Karl Hasselström <kha@treskal.com>
Date
Mar 20, 2008, 00:31 UTC
Message-ID
<20080320003145.13102.12700.stgit@yoghurt>
In-Reply-To
<20080320002604.13102.53757.stgit@yoghurt>

This should fail cleanly -- and in fact it does. Except for printing an assertion backtrace instead of a nice error message. (This is a regression introduced by the conversion of "stg uncommit" to the new infrastructure.)

Found by Erik Sandberg <mandolaerik@gmail.com>.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t1300-uncommit.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh
index d86e579..0d952a7 100755
--- a/t/t1300-uncommit.sh
+++ b/t/t1300-uncommit.sh
@@ -78,4 +78,9 @@ test_expect_success \
     stg commit --all
 '
 
+test_expect_failure 'Uncommit a commit with not precisely one parent' '
+    stg uncommit -n 5 ; [ $? = 2 ] &&
+    [ "$(echo $(stg series))" = "" ]
+'
+
 test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 4 of 14 in “Two bugfixes”
  1. 0/6 Two bugfixesKarl Hasselström, Mar 20, 2008
  2. 1/6 Use a special exit code for bugsKarl Hasselström, Mar 20, 2008
  3. 2/6 Make sure patches with no parents have an empty list of parentsKarl Hasselström, Mar 20, 2008
  4. 3/6 Try uncommitting a commit with not exactly one parentKarl Hasselström, Mar 20, 2008
  5. 4/6 Make sure that we only uncommit commits with exactly one parentKarl Hasselström, Mar 20, 2008
  6. 5/6 New test: conflicting push in dirty worktreeKarl Hasselström, Mar 20, 2008
  7. 6/6 Handle failed pushes differently depending on causeKarl Hasselström, Mar 20, 2008
  8. Catalin MarinasMar 20, 2008
  9. Karl HasselströmMar 24, 2008
  10. Catalin MarinasMar 24, 2008
  11. Karl HasselströmMar 24, 2008
  12. Catalin MarinasMar 25, 2008
  13. Karl HasselströmMar 25, 2008
  14. Catalin MarinasMar 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.