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

Re: [PATCH] pager: config variable pager.color

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 29, 2006, 23:15 UTC
Message-ID
<Pine.LNX.4.63.0607300112340.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<E1G6xHb-0008Rw-G2@moooo.ath.cx>
Hi,
On Sun, 30 Jul 2006, Matthias Lederhofer wrote:
Show 36 quoted lines
> diff --git a/builtin-log.c b/builtin-log.c
> index 82c69d1..7fdefec 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -34,7 +34,6 @@ static int cmd_log_walk(struct rev_info 
>  	struct commit *commit;
>  
>  	prepare_revision_walk(rev);
> -	setup_pager();
>  	while ((commit = get_revision(rev)) != NULL) {
>  		log_tree_commit(rev, commit);
>  		free(commit->buffer);
> @@ -49,6 +48,7 @@ int cmd_whatchanged(int argc, const char
>  {
>  	struct rev_info rev;
>  
> +	setup_pager();
>  	git_config(git_diff_ui_config);
>  	init_revisions(&rev, prefix);
>  	rev.diff = 1;
> @@ -64,6 +64,7 @@ int cmd_show(int argc, const char **argv
>  {
>  	struct rev_info rev;
>  
> +	setup_pager();
>  	git_config(git_diff_ui_config);
>  	init_revisions(&rev, prefix);
>  	rev.diff = 1;
> @@ -81,6 +82,7 @@ int cmd_log(int argc, const char **argv,
>  {
>  	struct rev_info rev;
>  
> +	setup_pager();
>  	git_config(git_diff_ui_config);
>  	init_revisions(&rev, prefix);
>  	rev.always_show_header = 1;

Why? The three users of cmd_log_walk() need to call setup_pager() explicitely, when cmd_log_walk() can do it for them?

Oh, and I do not really understand why you would enable color _at all_ if you want to disable it when paging. Do you have many instances when you want a color diff which is short enough not to be paged?

Ciao, Dscho

Previous: Matthias LederhoferNext: Matthias Lederhofer
Message 2 of 8 in “pager: config variable pager.color”
  1. pager: config variable pager.colorMatthias Lederhofer, Jul 29, 2006
  2. Johannes SchindelinJul 29, 2006
  3. Matthias LederhoferJul 30, 2006
  4. Johannes SchindelinJul 30, 2006
  5. Junio C HamanoJul 31, 2006
  6. Juergen RuehleJul 31, 2006
  7. Junio C HamanoJul 31, 2006
  8. Matthias LederhoferJul 31, 2006

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.