{"thread":{"id":"59372","subject":"[PATCH] sequencer: change amend advice to an actual advice","startedAt":"2023-03-10T01:47:45Z","lastAt":"2023-03-10T01:47:45Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"473332","messageId":"20230310014740.1076715-1-felipe.contreras@gmail.com","threadId":"59372","inReplyTo":null,"subject":"[PATCH] sequencer: change amend advice to an actual advice","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2023-03-10T01:47:40Z","receivedAt":"2023-03-10T01:47:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Show it like a proper advice, and also allow the possibility to turn\nthat off for experts who don't need this annoying advice.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/config/advice.txt | 2 ++\n advice.c                        | 1 +\n advice.h                        | 1 +\n sequencer.c                     | 2 +-\n 4 files changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config/advice.txt b/Documentation/config/advice.txt\nindex a00d0100a8..f493af466a 100644\n--- a/Documentation/config/advice.txt\n+++ b/Documentation/config/advice.txt\n@@ -80,6 +80,8 @@ advice.*::\n \t\tprevent the operation from being performed.\n \tsequencerInUse::\n \t\tAdvice shown when a sequencer command is already in progress.\n+\tsequencerToAmend::\n+\t\tAdvice shown when a sequencer is ready to ammend a commit.\n \timplicitIdentity::\n \t\tAdvice on how to set your identity configuration when\n \t\tyour information is guessed from the system username and\ndiff --git a/advice.c b/advice.c\nindex fd18968943..28e7401c68 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -66,6 +66,7 @@ static struct {\n \t[ADVICE_RESOLVE_CONFLICT]\t\t\t= { \"resolveConflict\", 1 },\n \t[ADVICE_RM_HINTS]\t\t\t\t= { \"rmHints\", 1 },\n \t[ADVICE_SEQUENCER_IN_USE]\t\t\t= { \"sequencerInUse\", 1 },\n+\t[ADVICE_SEQUENCER_TO_AMEND]\t\t\t= { \"sequencerToAmend\", 1 },\n \t[ADVICE_SET_UPSTREAM_FAILURE]\t\t\t= { \"setUpstreamFailure\", 1 },\n \t[ADVICE_SKIPPED_CHERRY_PICKS]\t\t\t= { \"skippedCherryPicks\", 1 },\n \t[ADVICE_STATUS_AHEAD_BEHIND_WARNING]\t\t= { \"statusAheadBehindWarning\", 1 },\ndiff --git a/advice.h b/advice.h\nindex 07e0f76833..933a6614ca 100644\n--- a/advice.h\n+++ b/advice.h\n@@ -41,6 +41,7 @@ struct string_list;\n \tADVICE_RESOLVE_CONFLICT,\n \tADVICE_RM_HINTS,\n \tADVICE_SEQUENCER_IN_USE,\n+\tADVICE_SEQUENCER_TO_AMEND,\n \tADVICE_SET_UPSTREAM_FAILURE,\n \tADVICE_STATUS_AHEAD_BEHIND_WARNING,\n \tADVICE_STATUS_HINTS,\ndiff --git a/sequencer.c b/sequencer.c\nindex 1c96a75b1e..e5831907f6 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -3559,7 +3559,7 @@ static int error_with_patch(struct repository *r,\n \t\tif (intend_to_amend())\n \t\t\treturn -1;\n \n-\t\tfprintf(stderr,\n+\t\tadvise_if_enabled(ADVICE_SEQUENCER_TO_AMEND,\n \t\t\t_(\"You can amend the commit now, with\\n\"\n \t\t\t  \"\\n\"\n \t\t\t  \"  git commit --amend %s\\n\"\n-- \n2.40.0.rc2.1.gf652911b76.dirty\n\n"}]}