From ef1d9c5aa4c8fd57b2a8043c0cd9fea1c507db6a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 27 Jul 2006 22:55:44 -0700 Subject: log and diff family: honor config even from subdirectories There currently is an unfortunate circular dependency between what init_revisions (the command line revision specification parser) does and setting up the log and diff options. The function uses setup_git_directory() to find the root of the project relative to the current directory and calls diff_setup() to prepare diff generation. However, some of the things that diff_setup() does needs to depend on the configuration variable, which needs to be read after setup_git_directory() is called. This patch is a low impact workaround. It first lets init_revisions() to run and do its thing, then uses git_config() and diff_setup() after it returns, so that configuration variables that affects the diff operation can be used from subdirectories. Signed-off-by: Junio C Hamano --- builtin-log.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'builtin-log.c') diff --git a/builtin-log.c b/builtin-log.c index 4052cc75b..88c835acb 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -49,8 +49,9 @@ int cmd_whatchanged(int argc, const char **argv, char **envp) { struct rev_info rev; - git_config(git_diff_ui_config); init_revisions(&rev); + git_config(git_diff_ui_config); + diff_setup(&rev.diffopt); rev.diff = 1; rev.diffopt.recursive = 1; rev.simplify_history = 0; @@ -64,8 +65,9 @@ int cmd_show(int argc, const char **argv, char **envp) { struct rev_info rev; - git_config(git_diff_ui_config); init_revisions(&rev); + git_config(git_diff_ui_config); + diff_setup(&rev.diffopt); rev.diff = 1; rev.diffopt.recursive = 1; rev.combine_merges = 1; @@ -81,8 +83,9 @@ int cmd_log(int argc, const char **argv, char **envp) { struct rev_info rev; - git_config(git_diff_ui_config); init_revisions(&rev); + git_config(git_diff_ui_config); + diff_setup(&rev.diffopt); rev.always_show_header = 1; cmd_log_init(argc, argv, envp, &rev); return cmd_log_walk(&rev); -- cgit v1.2.1