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

[PATCH] builtin-log: respect diff configuration options

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 7, 2006, 10:10 UTC
Message-ID
<11522670482020-git-send-email-normalperson@yhbt.net>
In-Reply-To
<11522670473116-git-send-email-normalperson@yhbt.net>

The log commands are all capable of generating diffs, so we should respect those configuration options for diffs here.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 builtin-log.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 864c6cd..698b71e 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -47,6 +47,7 @@ int cmd_whatchanged(int argc, const char
 {
 	struct rev_info rev;
 
+	git_config(git_diff_config);
 	init_revisions(&rev);
 	rev.diff = 1;
 	rev.diffopt.recursive = 1;
@@ -61,6 +62,7 @@ int cmd_show(int argc, const char **argv
 {
 	struct rev_info rev;
 
+	git_config(git_diff_config);
 	init_revisions(&rev);
 	rev.diff = 1;
 	rev.diffopt.recursive = 1;
@@ -77,6 +79,7 @@ int cmd_log(int argc, const char **argv,
 {
 	struct rev_info rev;
 
+	git_config(git_diff_config);
 	init_revisions(&rev);
 	rev.always_show_header = 1;
 	cmd_log_init(argc, argv, envp, &rev);
@@ -102,7 +105,7 @@ static int git_format_config(const char 
 		strcat(extra_headers, value);
 		return 0;
 	}
-	return git_default_config(var, value);
+	return git_diff_config(var, value);
 }
 
 
@@ -234,6 +237,7 @@ int cmd_format_patch(int argc, const cha
 	struct diff_options patch_id_opts;
 	char *add_signoff = NULL;
 
+	git_config(git_format_config);
 	init_revisions(&rev);
 	rev.commit_format = CMIT_FMT_EMAIL;
 	rev.verbose_header = 1;
@@ -243,7 +247,6 @@ int cmd_format_patch(int argc, const cha
 	rev.diffopt.msg_sep = "";
 	rev.diffopt.recursive = 1;
 
-	git_config(git_format_config);
 	rev.extra_headers = extra_headers;
 
 	/*
-- 
1.4.1.g3dc65
Previous: Eric WongNext: Junio C Hamano
Message 3 of 13 in “I forgot to run format-patch with the -M flag”
  1. 0/1 I forgot to run format-patch with the -M flagEric Wong, Jul 7, 2006
  2. diff.c: respect diff.renames config optionEric Wong, Jul 7, 2006
  3. builtin-log: respect diff configuration optionsEric Wong, Jul 7, 2006
  4. Junio C HamanoJul 7, 2006
  5. Junio C HamanoJul 7, 2006
  6. Junio C HamanoJul 7, 2006
  7. Junio C HamanoJul 7, 2006
  8. Fix several places where diff.renames in config can be problematicEric Wong, Jul 8, 2006
  9. Junio C HamanoJul 8, 2006
  10. Eric WongJul 8, 2006
  11. templates/hooks--update: replace diffstat calls with git diff --statEric Wong, Jul 8, 2006
  12. Junio C HamanoJul 7, 2006
  13. update Documentation/diff-options.txtJunio C Hamano, Jul 7, 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.