From: Jeff King Date: Mon, 13 Jun 2016 11:56:08 GMT Subject: Re: [PATCH] lib-httpd.sh: print error.log on error Message-ID: <20160613115608.GA5652@sigill.intra.peff.net> In-Reply-To: <20160613114014.GA15562@ash> On Mon, Jun 13, 2016 at 06:40:14PM +0700, Duy Nguyen wrote: > I like the verbose route, so here's v2 I think this is OK, though... > diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh > index f9f3e5f..67bc7ad 100644 > --- a/t/lib-httpd.sh > +++ b/t/lib-httpd.sh > @@ -180,6 +180,8 @@ start_httpd() { > if test $? -ne 0 > then > trap 'die' EXIT > + test "$verbose" = t && \ > + cat "$HTTPD_ROOT_PATH"/error.log 2>/dev/null I think you can just spell this: cat >&4 ... (I had originally thought that we set up those fds only inside the test_expect blocks, but it is the redirection 2>&4 that we set up there; you can always use fd 4 as necessary). It does incur a useless "cat" when we are not verbose, but I don't think that's a big deal for the error path like this. -Peff