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

Re: [PATCH] format-patch: page output with --stdout

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 22, 2010, 18:15 UTC
Message-ID
<20101122181501.GF2084@burratino>
In-Reply-To
<1290229542-3116-1-git-send-email-rctay89@gmail.com>
Tay Ray Chuan wrote:
Show 8 quoted lines
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -1159,6 +1159,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>  
>  	if (!use_stdout)
>  		output_directory = set_outdir(prefix, output_directory);
> +	else
> +		setup_pager();
Since it can be disabled with
	[pager]
		format-patch = false

this looks reasonable to me. Maybe a test to that effect would help, something like this?

 test_expect_success TTY 'format-patch --stdout paginates' '
	rm -f pager_used &&
	(
		GIT_PAGER="wc >pager_used" &&
		export GIT_PAGER &&
		test_terminal git format-patch --stdout --all
	) &&
	test_path_is_file pager_used
 '
 test_expect_success TTY 'format-patch --stdout pagination can be disabled' '
	rm -f pager_used &&
	(
		GIT_PAGER="wc >pager_used" &&
		export GIT_PAGER &&
		test_terminal git --no-pager format-patch --stdout --all &&
		test_terminal git -c "pager.format-patch=false" format-patch --stdout --all
	) &&
	test_path_is_missing pager_used &&
	test_path_is_missing .git/pager_used
 '
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 2 of 3 in “format-patch: page output with --stdout”
  1. format-patch: page output with --stdoutTay Ray Chuan, Nov 20, 2010
  2. Jonathan NiederNov 22, 2010
  3. format-patch: page output with --stdoutTay Ray Chuan, Nov 23, 2010

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.