git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] lib-httpd.sh: print error.log on error

From
Jeff King <peff@peff.net>
Date
Jun 13, 2016, 11:56 UTC
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...
Show 10 quoted lines
> 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
Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 4 of 6 in “lib-httpd.sh: print error.log on error”
  1. lib-httpd.sh: print error.log on errorNguyễn Thái Ngọc Duy, Jun 12, 2016
  2. Jeff KingJun 12, 2016
  3. Duy NguyenJun 13, 2016
  4. Jeff KingJun 13, 2016
  5. lib-httpd.sh: print error.log on errorNguyễn Thái Ngọc Duy, Jun 13, 2016
  6. Jeff KingJun 13, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.