From: kristofferhaugsbakk@fastmail.com Date: Fri, 22 Aug 2025 12:49:58 GMT Subject: [PATCH v3] bugreport: use quoted line prefixes & more blank lines Message-ID: <3d00cdbe8535fda8f9e72b5243090e6d953c133e.1755866791.git.code@khaugsbakk.name> In-Reply-To: <52a6177e706d8653251c61bc660f10b703ea6a9e.1755256099.git.code@khaugsbakk.name> From: Kristoffer Haugsbakk Quoted line prefixes make it easier to distinguish between the questions and the answers, both for the reporter and for the readers. Also try to nudge the user to submit a report with a blank line separating the end of the question, the answer, and the next question.[1] (Or leave optional answers empty, i.e. with three blank lines. That should be fine too.) [1]: Suggested by Junio Based-on-patch-by: Felipe Contreras Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk --- Notes (series): § Changes in v3 • Don’t quote the introduction (not a question and not needed) • Also try to nudge the user to leave enough blank lines • Keep using one single patch for less test file churn even though these are two changes in one I considered being cute with the footnote: ... question.[1] ... Based-on-patch-by: Felipe Contreras [1]: Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk § Changes in v2 • Update test which wasn’t there when v1 was made • Rewrite commit message to one single sentence • “use” in the subject is slightly more declarative than “add” (?) builtin/bugreport.c | 27 ++++++++++++++++++++------- t/t0091-bugreport.sh | 27 ++++++++++++++++++++------- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/builtin/bugreport.c b/builtin/bugreport.c index f78c3f2aed6..694ab85d8cb 100644 --- a/builtin/bugreport.c +++ b/builtin/bugreport.c @@ -67,19 +67,32 @@ static int get_bug_template(struct strbuf *template) const char template_text[] = N_( "Thank you for filling out a Git bug report!\n" "Please answer the following questions to help us understand your issue.\n" +"There are three blank lines after each question; please write your\n" +"response on the second line and keep a blank line betweeen the question\n" +"and the answer (beginning and end).\n" "\n" -"What did you do before the bug happened? (Steps to reproduce your issue)\n" +"> What did you do before the bug happened? (Steps to reproduce your issue)\n" "\n" -"What did you expect to happen? (Expected behavior)\n" "\n" -"What happened instead? (Actual behavior)\n" "\n" -"What's different between what you expected and what actually happened?\n" +"> What did you expect to happen? (Expected behavior)\n" "\n" -"Anything else you want to add:\n" "\n" -"Please review the rest of the bug report below.\n" -"You can delete any lines you don't wish to share.\n"); +"\n" +"> What happened instead? (Actual behavior)\n" +"\n" +"\n" +"\n" +"> What's different between what you expected and what actually happened?\n" +"\n" +"\n" +"\n" +"> Anything else you want to add:\n" +"\n" +"\n" +"\n" +"> Please review the rest of the bug report below.\n" +"> You can delete any lines you don't wish to share.\n"); strbuf_addstr(template, _(template_text)); return 0; diff --git a/t/t0091-bugreport.sh b/t/t0091-bugreport.sh index e38ca7a9018..facaf1a5373 100755 --- a/t/t0091-bugreport.sh +++ b/t/t0091-bugreport.sh @@ -14,19 +14,32 @@ test_expect_success 'report contains wanted template (before first section)' ' cat >expect <<-\EOF && Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue. + There are three blank lines after each question; please write your + response on the second line and keep a blank line betweeen the question + and the answer (beginning and end). - What did you do before the bug happened? (Steps to reproduce your issue) + > What did you do before the bug happened? (Steps to reproduce your issue) - What did you expect to happen? (Expected behavior) - What happened instead? (Actual behavior) - What'\''s different between what you expected and what actually happened? + > What did you expect to happen? (Expected behavior) - Anything else you want to add: - Please review the rest of the bug report below. - You can delete any lines you don'\''t wish to share. + + > What happened instead? (Actual behavior) + + + + > What'\''s different between what you expected and what actually happened? + + + + > Anything else you want to add: + + + + > Please review the rest of the bug report below. + > You can delete any lines you don'\''t wish to share. EOF Interdiff against v2: diff --git a/builtin/bugreport.c b/builtin/bugreport.c index 44be7eb4859..694ab85d8cb 100644 --- a/builtin/bugreport.c +++ b/builtin/bugreport.c @@ -65,19 +65,32 @@ static const char * const bugreport_usage[] = { static int get_bug_template(struct strbuf *template) { const char template_text[] = N_( -"> Thank you for filling out a Git bug report!\n" -"> Please answer the following questions to help us understand your issue.\n" +"Thank you for filling out a Git bug report!\n" +"Please answer the following questions to help us understand your issue.\n" +"There are three blank lines after each question; please write your\n" +"response on the second line and keep a blank line betweeen the question\n" +"and the answer (beginning and end).\n" "\n" "> What did you do before the bug happened? (Steps to reproduce your issue)\n" "\n" +"\n" +"\n" "> What did you expect to happen? (Expected behavior)\n" "\n" +"\n" +"\n" "> What happened instead? (Actual behavior)\n" "\n" +"\n" +"\n" "> What's different between what you expected and what actually happened?\n" "\n" +"\n" +"\n" "> Anything else you want to add:\n" "\n" +"\n" +"\n" "> Please review the rest of the bug report below.\n" "> You can delete any lines you don't wish to share.\n"); diff --git a/t/t0091-bugreport.sh b/t/t0091-bugreport.sh index 9d7008f3592..facaf1a5373 100755 --- a/t/t0091-bugreport.sh +++ b/t/t0091-bugreport.sh @@ -12,19 +12,32 @@ test_expect_success 'create a report' ' test_expect_success 'report contains wanted template (before first section)' ' sed -ne "/^\[/q;p" git-bugreport-format.txt >actual && cat >expect <<-\EOF && - > Thank you for filling out a Git bug report! - > Please answer the following questions to help us understand your issue. + Thank you for filling out a Git bug report! + Please answer the following questions to help us understand your issue. + There are three blank lines after each question; please write your + response on the second line and keep a blank line betweeen the question + and the answer (beginning and end). > What did you do before the bug happened? (Steps to reproduce your issue) + + > What did you expect to happen? (Expected behavior) + + > What happened instead? (Actual behavior) + + > What'\''s different between what you expected and what actually happened? + + > Anything else you want to add: + + > Please review the rest of the bug report below. > You can delete any lines you don'\''t wish to share. Range-diff against v2: 1: 52a6177e706 ! 1: 3d00cdbe853 bugreport: use quoted line prefixes @@ Metadata Author: Kristoffer Haugsbakk ## Commit message ## - bugreport: use quoted line prefixes + bugreport: use quoted line prefixes & more blank lines Quoted line prefixes make it easier to distinguish between the questions and the answers, both for the reporter and for the readers. + Also try to nudge the user to submit a report with a blank line + separating the end of the question, the answer, and the next + question.[1] (Or leave optional answers empty, i.e. with three + blank lines. That should be fine too.) + + [1]: Suggested by Junio + Based-on-patch-by: Felipe Contreras + Suggested-by: Junio C Hamano Signed-off-by: Kristoffer Haugsbakk ## Notes (series) ## + § Changes in v3 + + • Don’t quote the introduction (not a question and not needed) + • Also try to nudge the user to leave enough blank lines + • Keep using one single patch for less test file churn even though these + are two changes in one + + I considered being cute with the footnote: + + ... + question.[1] ... + + Based-on-patch-by: Felipe Contreras + [1]: + Suggested-by: Junio C Hamano + Signed-off-by: Kristoffer Haugsbakk + § Changes in v2 • Update test which wasn’t there when v1 was made @@ Notes (series) • “use” in the subject is slightly more declarative than “add” (?) ## builtin/bugreport.c ## -@@ builtin/bugreport.c: static const char * const bugreport_usage[] = { - static int get_bug_template(struct strbuf *template) - { +@@ builtin/bugreport.c: static int get_bug_template(struct strbuf *template) const char template_text[] = N_( --"Thank you for filling out a Git bug report!\n" --"Please answer the following questions to help us understand your issue.\n" -+"> Thank you for filling out a Git bug report!\n" -+"> Please answer the following questions to help us understand your issue.\n" + "Thank you for filling out a Git bug report!\n" + "Please answer the following questions to help us understand your issue.\n" ++"There are three blank lines after each question; please write your\n" ++"response on the second line and keep a blank line betweeen the question\n" ++"and the answer (beginning and end).\n" "\n" -"What did you do before the bug happened? (Steps to reproduce your issue)\n" +"> What did you do before the bug happened? (Steps to reproduce your issue)\n" "\n" -"What did you expect to happen? (Expected behavior)\n" -+"> What did you expect to happen? (Expected behavior)\n" "\n" -"What happened instead? (Actual behavior)\n" -+"> What happened instead? (Actual behavior)\n" "\n" -"What's different between what you expected and what actually happened?\n" -+"> What's different between what you expected and what actually happened?\n" ++"> What did you expect to happen? (Expected behavior)\n" "\n" -"Anything else you want to add:\n" -+"> Anything else you want to add:\n" "\n" -"Please review the rest of the bug report below.\n" -"You can delete any lines you don't wish to share.\n"); ++"\n" ++"> What happened instead? (Actual behavior)\n" ++"\n" ++"\n" ++"\n" ++"> What's different between what you expected and what actually happened?\n" ++"\n" ++"\n" ++"\n" ++"> Anything else you want to add:\n" ++"\n" ++"\n" ++"\n" +"> Please review the rest of the bug report below.\n" +"> You can delete any lines you don't wish to share.\n"); @@ builtin/bugreport.c: static const char * const bugreport_usage[] = { return 0; ## t/t0091-bugreport.sh ## -@@ t/t0091-bugreport.sh: test_expect_success 'create a report' ' - test_expect_success 'report contains wanted template (before first section)' ' - sed -ne "/^\[/q;p" git-bugreport-format.txt >actual && +@@ t/t0091-bugreport.sh: test_expect_success 'report contains wanted template (before first section)' ' cat >expect <<-\EOF && -- Thank you for filling out a Git bug report! -- Please answer the following questions to help us understand your issue. -+ > Thank you for filling out a Git bug report! -+ > Please answer the following questions to help us understand your issue. + Thank you for filling out a Git bug report! + Please answer the following questions to help us understand your issue. ++ There are three blank lines after each question; please write your ++ response on the second line and keep a blank line betweeen the question ++ and the answer (beginning and end). - What did you do before the bug happened? (Steps to reproduce your issue) + > What did you do before the bug happened? (Steps to reproduce your issue) - What did you expect to happen? (Expected behavior) -+ > What did you expect to happen? (Expected behavior) - What happened instead? (Actual behavior) -+ > What happened instead? (Actual behavior) - What'\''s different between what you expected and what actually happened? -+ > What'\''s different between what you expected and what actually happened? ++ > What did you expect to happen? (Expected behavior) - Anything else you want to add: -+ > Anything else you want to add: - Please review the rest of the bug report below. - You can delete any lines you don'\''t wish to share. ++ ++ > What happened instead? (Actual behavior) ++ ++ ++ ++ > What'\''s different between what you expected and what actually happened? ++ ++ ++ ++ > Anything else you want to add: ++ ++ ++ + > Please review the rest of the bug report below. + > You can delete any lines you don'\''t wish to share. base-commit: 724518f3884d8707c5f51428ba98c115818229b8 -- 2.50.1