Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first

4 messages, 4 authors, 2018-05-30 · open the first message on its own page

Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first

From: Junio C Hamano <hidden>
Date: 2018-05-28 09:25:28

Martin Ågren [off-list ref] writes:
quoted hunk
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 0c6f48f302..31b0702e6c 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '
 	test_must_fail git checkout top 2>actual &&
 	cat >expected <<\EOF &&
 error: The following untracked working tree files would be overwritten by checkout:
-	sub/added
-	sub/addedtoo
-Please move or remove them before you switch branches.
+error: 	sub/added
+error: 	sub/addedtoo
+error: Please move or remove them before you switch branches.
 Aborting
 EOF
This shows the typical effect of this series, which (I subjectively
think) gives us a more pleasant end-user experience.
quoted hunk
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 4ee009da66..80d35087b7 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -11,7 +11,7 @@ test_did_you_mean ()
 	sq="'" &&
 	cat >expected <<-EOF &&
 	fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
-	Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
+	fatal: Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
 	EOF
And this, too.
quoted hunk
diff --git a/usage.c b/usage.c
index 80f9c1d14b..6a5669922f 100644
--- a/usage.c
+++ b/usage.c
@@ -34,7 +34,7 @@ void vreportf(const char *prefix, const char *err, va_list params)
 		if (iscntrl(*p) && *p != '\t' && *p != '\n')
 			*p = '?';
 	}
-	fprintf(stderr, "%s%s\n", prefix, msg);
+	prefix_suffix_lines(stderr, prefix, msg, "");
 }

Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first

From: Duy Nguyen <hidden>
Date: 2018-05-28 18:45:53

On Mon, May 28, 2018 at 11:25 AM, Junio C Hamano [off-list ref] wrote:
Martin Ågren [off-list ref] writes:
quoted
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 0c6f48f302..31b0702e6c 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '
      test_must_fail git checkout top 2>actual &&
      cat >expected <<\EOF &&
 error: The following untracked working tree files would be overwritten by checkout:
-     sub/added
-     sub/addedtoo
-Please move or remove them before you switch branches.
+error:       sub/added
+error:       sub/addedtoo
+error: Please move or remove them before you switch branches.
 Aborting
 EOF
This shows the typical effect of this series, which (I subjectively
think) gives us a more pleasant end-user experience.
Also, very subjectively, I'm torn about this. To me, just one
"error/warning/fatal" at the start of the first paragraph feels much
better. If we have to somehow mark the second paragraph that "this is
also part of the error message" then it's probably better to rephrase.
-- 
Duy

Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first

From: Jeff King <hidden>
Date: 2018-05-29 21:32:49

On Mon, May 28, 2018 at 06:25:18PM +0900, Junio C Hamano wrote:
Martin Ågren [off-list ref] writes:
quoted
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 0c6f48f302..31b0702e6c 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '
 	test_must_fail git checkout top 2>actual &&
 	cat >expected <<\EOF &&
 error: The following untracked working tree files would be overwritten by checkout:
-	sub/added
-	sub/addedtoo
-Please move or remove them before you switch branches.
+error: 	sub/added
+error: 	sub/addedtoo
+error: Please move or remove them before you switch branches.
 Aborting
 EOF
This shows the typical effect of this series, which (I subjectively
think) gives us a more pleasant end-user experience.
Heh, that is one of the cases that I found most ugly when I looked into
this earlier (and in particular, because I think it makes cut-and-paste
a little harder).

More discussion in:

  https://public-inbox.org/git/20170111140758.yyfsc3r3spqpi6es@sigill.intra.peff.net/

and down-thread.

-Peff

Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first

From: Martin Ågren <hidden>
Date: 2018-05-30 10:20:18

On 29 May 2018 at 23:32, Jeff King [off-list ref] wrote:
On Mon, May 28, 2018 at 06:25:18PM +0900, Junio C Hamano wrote:
quoted
This shows the typical effect of this series, which (I subjectively
think) gives us a more pleasant end-user experience.
Heh, that is one of the cases that I found most ugly when I looked into
this earlier (and in particular, because I think it makes cut-and-paste
a little harder).

More discussion in:

  https://public-inbox.org/git/20170111140758.yyfsc3r3spqpi6es@sigill.intra.peff.net/

and down-thread.
Thanks for the pointer. I had missed that thread entirely.

Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help