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

[PATCH v2 2/5] am: Change safe_to_abort()'s not rewinding error into a warning

From
Stephan Beyer <s-beyer@gmx.net>
Date
Dec 9, 2016, 19:01 UTC
Message-ID
<20161209190111.9571-2-s-beyer@gmx.net>
In-Reply-To
<20161209190111.9571-1-s-beyer@gmx.net>

The error message tells the user that something went terribly wrong and the --abort could not be performed. But the --abort is performed, only without rewinding. By simply changing the error into a warning, we indicate the user that she must not try something like "git am --abort --force", instead she just has to check the HEAD.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
 builtin/am.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/am.c b/builtin/am.c
index 7cf40e6f2..826f18ba1 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2134,7 +2134,7 @@ static int safe_to_abort(const struct am_state *state)
 	if (!oidcmp(&head, &abort_safety))
 		return 1;
 
-	error(_("You seem to have moved HEAD since the last 'am' failure.\n"
+	warning(_("You seem to have moved HEAD since the last 'am' failure.\n"
 		"Not rewinding to ORIG_HEAD"));
 
 	return 0;
-- 
2.11.0.27.g74d6bea
Previous: Stephan BeyerNext: Stephan Beyer
Message 9 of 18 in “am: Fix filename in safe_to_abort() error message”
  1. 1/5 am: Fix filename in safe_to_abort() error messageStephan Beyer, Dec 7, 2016
  2. 4/5 Make sequencer abort saferStephan Beyer, Dec 7, 2016
  3. Johannes SchindelinDec 8, 2016
  4. Junio C HamanoDec 8, 2016
  5. Stephan BeyerDec 8, 2016
  6. Junio C HamanoDec 9, 2016
  7. 1/5 am: Fix filename in safe_to_abort() error messageStephan Beyer, Dec 9, 2016
  8. 3/5 Add test that cherry-pick --abort does not unsafely change HEADStephan Beyer, Dec 9, 2016
  9. 2/5 am: Change safe_to_abort()'s not rewinding error into a warningStephan Beyer, Dec 9, 2016
  10. 4/5 Make sequencer abort saferStephan Beyer, Dec 9, 2016
  11. Christian CouderDec 10, 2016
  12. Jeff KingDec 10, 2016
  13. Stephan BeyerDec 10, 2016
  14. 5/5 sequencer: Remove useless get_dir() functionStephan Beyer, Dec 9, 2016
  15. 2/5 am: Change safe_to_abort()'s not rewinding error into a warningStephan Beyer, Dec 7, 2016
  16. 3/5 Add test that cherry-pick --abort does not unsafely change HEADStephan Beyer, Dec 7, 2016
  17. 5/5 sequencer: Remove useless get_dir() functionStephan Beyer, Dec 7, 2016
  18. Paul TanDec 8, 2016

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.