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

Re: [PATCH 2/2] pager_in_use: make sure output is still going to pager

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 10, 2015, 16:38 UTC
Message-ID
<98d092607588cb5c98e7a2deb2163f94@www.dscho.org>
In-Reply-To
<20150810052353.GB15441@sigill.intra.peff.net>
Hi Peff,
On 2015-08-10 07:23, Jeff King wrote:
Show 17 quoted lines
> diff --git a/compat/pipe-id.c b/compat/pipe-id.c
> new file mode 100644
> index 0000000..4764c5f
> --- /dev/null
> +++ b/compat/pipe-id.c
> @@ -0,0 +1,25 @@
> +#include "git-compat-util.h"
> +#include "compat/pipe-id.h"
> +#include "strbuf.h"
> +
> +const char *pipe_id_get(int fd)
> +{
> +	static struct strbuf id = STRBUF_INIT;
> +	struct stat st;
> +
> +	if (fstat(fd, &st) < 0 || !S_ISFIFO(st.st_mode))
> +		return NULL;
Just a quick note: it seems that this check is not really working on Windows. I tested this by running this test case manually (because TTY is not set on Windows):
Show 8 quoted lines
> +test_expect_success TTY 'no color when paged program writes to pipe' '
> +	test_config alias.externallog "!git log | cat >log.out" &&
> +	test_config color.ui auto &&
> +	test_terminal env TERM=vt100 git -p externallog &&
> +	test_line_count = 0 paginated.out &&
> +	test -s log.out &&
> +	! colorful log.out
> +'
The output is "colorful" ;-)
I hope to find some time tomorrow to figure out some workaround that makes this work on Windows.

Ciao, Dscho

Previous: Jeff KingNext: Jeff King
Message 6 of 8 in “"git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply”
  1. Per CederqvistAug 3, 2015
  2. Jeff KingAug 9, 2015
  3. Jeff KingAug 10, 2015
  4. 1/2 pager_in_use: use git_env_boolJeff King, Aug 10, 2015
  5. 2/2 pager_in_use: make sure output is still going to pagerJeff King, Aug 10, 2015
  6. Johannes SchindelinAug 10, 2015
  7. Jeff KingAug 10, 2015
  8. Per CederqvistAug 11, 2015

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.