{"thread":{"id":"52329","subject":"[PATCH] test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'","startedAt":"2019-11-25T12:59:16Z","lastAt":"2019-11-25T13:19:53Z","messageCount":2,"participants":["SZEDER Gábor","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"386983","messageId":"20191125125907.28967-1-szeder.dev@gmail.com","threadId":"52329","inReplyTo":null,"subject":"[PATCH] test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-11-25T12:59:07Z","receivedAt":"2019-11-25T12:59:16Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"When 'test_commit_bulk' is invoked in an empty test repository, it\nprints a \"fatal: Needed a single revision\" error, but still does what\nit's supposed to do.  A test helper function displaying a fatal error\nand still succeeding is always suspect to be buggy, but luckily that's\nnot the case here: that error comes from a 'git rev-parse --verify\nHEAD' command invoked in a condition, which doesn't have anything to\nverify in an empty repository.\n\nUse the '--quiet' option to suppress that error message.\n\nSigned-off-by: SZEDER Gábor <szeder.dev@gmail.com>\n---\n t/test-lib-functions.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex b299ecc326..6302bfb51d 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -308,7 +308,7 @@ test_commit_bulk () {\n \ttotal=$1\n \n \tadd_from=\n-\tif git -C \"$indir\" rev-parse --verify \"$ref\"\n+\tif git -C \"$indir\" rev-parse --quiet --verify \"$ref\"\n \tthen\n \t\tadd_from=t\n \tfi\n-- \n2.24.0.587.g7096fda53a\n\n"},{"id":"386985","messageId":"20191125131951.GA494@sigill.intra.peff.net","threadId":"52329","inReplyTo":"20191125125907.28967-1-szeder.dev@gmail.com","subject":"Re: [PATCH] test-lib-functions: suppress a 'git rev-parse' error in 'test_commit_bulk'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-11-25T13:19:51Z","receivedAt":"2019-11-25T13:19:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 25, 2019 at 01:59:07PM +0100, SZEDER Gábor wrote:\n\n> When 'test_commit_bulk' is invoked in an empty test repository, it\n> prints a \"fatal: Needed a single revision\" error, but still does what\n> it's supposed to do.  A test helper function displaying a fatal error\n> and still succeeding is always suspect to be buggy, but luckily that's\n> not the case here: that error comes from a 'git rev-parse --verify\n> HEAD' command invoked in a condition, which doesn't have anything to\n> verify in an empty repository.\n> \n> Use the '--quiet' option to suppress that error message.\n\nYep, makes perfect sense. Thanks.\n\n-Peff\n"}]}