git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'
@ 2018-10-29 12:13 SZEDER Gábor
  2018-10-29 14:21 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: SZEDER Gábor @ 2018-10-29 12:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, SZEDER Gábor

'--verbose-log' is one of the most useful and thus most frequently
used test options, but due to its length it's a pain to type on the
command line.

Let's introduce the corresponding short option '-V' to save some
keystrokes.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---

Or it could be '-L', to emphasize the "log" part of the long option, I
don't really care.

 t/README      | 1 +
 t/test-lib.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/README b/t/README
index 8847489640..2e9bef2852 100644
--- a/t/README
+++ b/t/README
@@ -154,6 +154,7 @@ appropriately before running "make".
 	As the names depend on the tests' file names, it is safe to
 	run the tests with this option in parallel.
 
+-V::
 --verbose-log::
 	Write verbose output to the same logfile as `--tee`, but do
 	_not_ write it to stdout. Unlike `--tee --verbose`, this option
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 897e6fcc94..47a99aa0ed 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -67,7 +67,7 @@ case "$GIT_TEST_TEE_STARTED, $* " in
 done,*)
 	# do not redirect again
 	;;
-*' --tee '*|*' --va'*|*' --verbose-log '*)
+*' --tee '*|*' --va'*|*' -V '*|*' --verbose-log '*)
 	mkdir -p "$TEST_OUTPUT_DIRECTORY/test-results"
 	BASE="$TEST_OUTPUT_DIRECTORY/test-results/$(basename "$0" .sh)"
 
@@ -316,7 +316,7 @@ do
 			echo >&2 "warning: ignoring -x; '$0' is untraceable without BASH_XTRACEFD"
 		fi
 		shift ;;
-	--verbose-log)
+	-V|--verbose-log)
 		verbose_log=t
 		shift ;;
 	*)
-- 
2.19.1.723.g6817e59acc


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'
  2018-10-29 14:21 ` Jeff King
@ 2018-10-29 13:53   ` SZEDER Gábor
  2018-10-29 15:42     ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: SZEDER Gábor @ 2018-10-29 13:53 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, git

On Mon, Oct 29, 2018 at 10:21:08AM -0400, Jeff King wrote:
> On Mon, Oct 29, 2018 at 01:13:59PM +0100, SZEDER Gábor wrote:
> 
> > '--verbose-log' is one of the most useful and thus most frequently
> > used test options, but due to its length it's a pain to type on the
> > command line.
> > 
> > Let's introduce the corresponding short option '-V' to save some
> > keystrokes.
> 
> Interesting. I'm not opposed to something like this, but I added
> "--verbose-log" specifically for scripted cases, like running an
> unattended "prove" that needs to preserve stdout. When running
> individual tests, I'd just use "-v" itself, and possibly redirect the
> output.
> 
> For my curiosity, can you describe your use case a bit more?

Even when I run individual test scripts by hand, I prefer to have a
file catching all output of the test, because I don't like it when the
test output floods my terminal (especially with '-x'), and because the
file is searchable but the terminal isn't.  And that's exactly what
'--verbose-log' does.

Redirecting the '-v' output (i.e. stdout) alone is insufficient,
because any error messages within the tests and the '-x' trace go to
stderr, so they still end up on the terminal.  Therefore I would have
to remember to redirect stderr every time as well.

I find it's much easier to just always use '--verbose-log'... except
for the length of the option, that is, hence this patch.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'
  2018-10-29 12:13 [PATCH] test-lib: introduce the '-V' short option for '--verbose-log' SZEDER Gábor
@ 2018-10-29 14:21 ` Jeff King
  2018-10-29 13:53   ` SZEDER Gábor
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2018-10-29 14:21 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Junio C Hamano, git

On Mon, Oct 29, 2018 at 01:13:59PM +0100, SZEDER Gábor wrote:

> '--verbose-log' is one of the most useful and thus most frequently
> used test options, but due to its length it's a pain to type on the
> command line.
> 
> Let's introduce the corresponding short option '-V' to save some
> keystrokes.

Interesting. I'm not opposed to something like this, but I added
"--verbose-log" specifically for scripted cases, like running an
unattended "prove" that needs to preserve stdout. When running
individual tests, I'd just use "-v" itself, and possibly redirect the
output.

For my curiosity, can you describe your use case a bit more?

>  t/README      | 1 +
>  t/test-lib.sh | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)

The patch itself looks good to me.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'
  2018-10-29 13:53   ` SZEDER Gábor
@ 2018-10-29 15:42     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2018-10-29 15:42 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Junio C Hamano, git

On Mon, Oct 29, 2018 at 02:53:35PM +0100, SZEDER Gábor wrote:

> > Interesting. I'm not opposed to something like this, but I added
> > "--verbose-log" specifically for scripted cases, like running an
> > unattended "prove" that needs to preserve stdout. When running
> > individual tests, I'd just use "-v" itself, and possibly redirect the
> > output.
> > 
> > For my curiosity, can you describe your use case a bit more?
> 
> Even when I run individual test scripts by hand, I prefer to have a
> file catching all output of the test, because I don't like it when the
> test output floods my terminal (especially with '-x'), and because the
> file is searchable but the terminal isn't.  And that's exactly what
> '--verbose-log' does.
> 
> Redirecting the '-v' output (i.e. stdout) alone is insufficient,
> because any error messages within the tests and the '-x' trace go to
> stderr, so they still end up on the terminal.  Therefore I would have
> to remember to redirect stderr every time as well.
> 
> I find it's much easier to just always use '--verbose-log'... except
> for the length of the option, that is, hence this patch.

OK, fair enough. Maybe I should start using "-V" too, then. ;)

(I find myself most often coupling "-v" with "-i" to stop at the failure
and just read what's left on the screen).

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-29 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 12:13 [PATCH] test-lib: introduce the '-V' short option for '--verbose-log' SZEDER Gábor
2018-10-29 14:21 ` Jeff King
2018-10-29 13:53   ` SZEDER Gábor
2018-10-29 15:42     ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).