Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:35

Hi,

On Sun, 30 Jul 2006, Matthias Lederhofer wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help