{"thread":{"id":"49707","subject":"[PATCH] test-lib: introduce the '-V' short option for '--verbose-log'","startedAt":"2018-10-29T13:14:14Z","lastAt":"2018-10-29T15:42:31Z","messageCount":4,"participants":["SZEDER Gábor","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"361892","messageId":"20181029121359.7323-1-szeder.dev@gmail.com","threadId":"49707","inReplyTo":null,"subject":"[PATCH] test-lib: introduce the '-V' short option for '--verbose-log'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-10-29T12:13:59Z","receivedAt":"2018-10-29T13:14:14Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"'--verbose-log' is one of the most useful and thus most frequently\nused test options, but due to its length it's a pain to type on the\ncommand line.\n\nLet's introduce the corresponding short option '-V' to save some\nkeystrokes.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n\nOr it could be '-L', to emphasize the \"log\" part of the long option, I\ndon't really care.\n\n t/README      | 1 +\n t/test-lib.sh | 4 ++--\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex 8847489640..2e9bef2852 100644\n--- a/t/README\n+++ b/t/README\n@@ -154,6 +154,7 @@ appropriately before running \"make\".\n \tAs the names depend on the tests' file names, it is safe to\n \trun the tests with this option in parallel.\n \n+-V::\n --verbose-log::\n \tWrite verbose output to the same logfile as `--tee`, but do\n \t_not_ write it to stdout. Unlike `--tee --verbose`, this option\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 897e6fcc94..47a99aa0ed 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -67,7 +67,7 @@ case \"$GIT_TEST_TEE_STARTED, $* \" in\n done,*)\n \t# do not redirect again\n \t;;\n-*' --tee '*|*' --va'*|*' --verbose-log '*)\n+*' --tee '*|*' --va'*|*' -V '*|*' --verbose-log '*)\n \tmkdir -p \"$TEST_OUTPUT_DIRECTORY/test-results\"\n \tBASE=\"$TEST_OUTPUT_DIRECTORY/test-results/$(basename \"$0\" .sh)\"\n \n@@ -316,7 +316,7 @@ do\n \t\t\techo >&2 \"warning: ignoring -x; '$0' is untraceable without BASH_XTRACEFD\"\n \t\tfi\n \t\tshift ;;\n-\t--verbose-log)\n+\t-V|--verbose-log)\n \t\tverbose_log=t\n \t\tshift ;;\n \t*)\n-- \n2.19.1.723.g6817e59acc\n\n"},{"id":"361900","messageId":"20181029142108.GD17668@sigill.intra.peff.net","threadId":"49707","inReplyTo":"20181029121359.7323-1-szeder.dev@gmail.com","subject":"Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-10-29T14:21:08Z","receivedAt":"2018-10-29T14:21:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 29, 2018 at 01:13:59PM +0100, SZEDER Gábor wrote:\n\n> '--verbose-log' is one of the most useful and thus most frequently\n> used test options, but due to its length it's a pain to type on the\n> command line.\n> \n> Let's introduce the corresponding short option '-V' to save some\n> keystrokes.\n\nInteresting. I'm not opposed to something like this, but I added\n\"--verbose-log\" specifically for scripted cases, like running an\nunattended \"prove\" that needs to preserve stdout. When running\nindividual tests, I'd just use \"-v\" itself, and possibly redirect the\noutput.\n\nFor my curiosity, can you describe your use case a bit more?\n\n>  t/README      | 1 +\n>  t/test-lib.sh | 4 ++--\n>  2 files changed, 3 insertions(+), 2 deletions(-)\n\nThe patch itself looks good to me.\n\n-Peff\n"},{"id":"361904","messageId":"20181029135335.GS30222@szeder.dev","threadId":"49707","inReplyTo":"20181029142108.GD17668@sigill.intra.peff.net","subject":"Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-10-29T13:53:35Z","receivedAt":"2018-10-29T14:53:42Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Oct 29, 2018 at 10:21:08AM -0400, Jeff King wrote:\n> On Mon, Oct 29, 2018 at 01:13:59PM +0100, SZEDER Gábor wrote:\n> \n> > '--verbose-log' is one of the most useful and thus most frequently\n> > used test options, but due to its length it's a pain to type on the\n> > command line.\n> > \n> > Let's introduce the corresponding short option '-V' to save some\n> > keystrokes.\n> \n> Interesting. I'm not opposed to something like this, but I added\n> \"--verbose-log\" specifically for scripted cases, like running an\n> unattended \"prove\" that needs to preserve stdout. When running\n> individual tests, I'd just use \"-v\" itself, and possibly redirect the\n> output.\n> \n> For my curiosity, can you describe your use case a bit more?\n\nEven when I run individual test scripts by hand, I prefer to have a\nfile catching all output of the test, because I don't like it when the\ntest output floods my terminal (especially with '-x'), and because the\nfile is searchable but the terminal isn't.  And that's exactly what\n'--verbose-log' does.\n\nRedirecting the '-v' output (i.e. stdout) alone is insufficient,\nbecause any error messages within the tests and the '-x' trace go to\nstderr, so they still end up on the terminal.  Therefore I would have\nto remember to redirect stderr every time as well.\n\nI find it's much easier to just always use '--verbose-log'... except\nfor the length of the option, that is, hence this patch.\n\n\n"},{"id":"361911","messageId":"20181029154228.GA27538@sigill.intra.peff.net","threadId":"49707","inReplyTo":"20181029135335.GS30222@szeder.dev","subject":"Re: [PATCH] test-lib: introduce the '-V' short option for '--verbose-log'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-10-29T15:42:28Z","receivedAt":"2018-10-29T15:42:31Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 29, 2018 at 02:53:35PM +0100, SZEDER Gábor wrote:\n\n> > Interesting. I'm not opposed to something like this, but I added\n> > \"--verbose-log\" specifically for scripted cases, like running an\n> > unattended \"prove\" that needs to preserve stdout. When running\n> > individual tests, I'd just use \"-v\" itself, and possibly redirect the\n> > output.\n> > \n> > For my curiosity, can you describe your use case a bit more?\n> \n> Even when I run individual test scripts by hand, I prefer to have a\n> file catching all output of the test, because I don't like it when the\n> test output floods my terminal (especially with '-x'), and because the\n> file is searchable but the terminal isn't.  And that's exactly what\n> '--verbose-log' does.\n> \n> Redirecting the '-v' output (i.e. stdout) alone is insufficient,\n> because any error messages within the tests and the '-x' trace go to\n> stderr, so they still end up on the terminal.  Therefore I would have\n> to remember to redirect stderr every time as well.\n> \n> I find it's much easier to just always use '--verbose-log'... except\n> for the length of the option, that is, hence this patch.\n\nOK, fair enough. Maybe I should start using \"-V\" too, then. ;)\n\n(I find myself most often coupling \"-v\" with \"-i\" to stop at the failure\nand just read what's left on the screen).\n\n-Peff\n"}]}