summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dee4e38)
raw | patch | inline | side by side (parent: dee4e38)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 28 Jul 2006 05:55:44 +0000 (22:55 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 28 Jul 2006 05:55:44 +0000 (22:55 -0700) |
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 <junkio@cox.net>
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 <junkio@cox.net>
diff --git a/builtin-diff-files.c b/builtin-diff-files.c
index 81ac2fe64aea23f9db605da181da098dcfca757a..2e10118623e773253d57719fdba853e6fde4f776 100644 (file)
--- a/builtin-diff-files.c
+++ b/builtin-diff-files.c
struct rev_info rev;
int silent = 0;
- git_config(git_default_config); /* no "diff" UI options */
init_revisions(&rev);
+ git_config(git_default_config); /* no "diff" UI options */
rev.abbrev = 0;
argc = setup_revisions(argc, argv, &rev, NULL);
diff --git a/builtin-diff-index.c b/builtin-diff-index.c
index a1fa1b85cf741cd6b5f06afd02abbe618e86f5d1..dc52c054ee680132ea2a5041d84c976cf036c773 100644 (file)
--- a/builtin-diff-index.c
+++ b/builtin-diff-index.c
int cached = 0;
int i;
- git_config(git_default_config); /* no "diff" UI options */
init_revisions(&rev);
+ git_config(git_default_config); /* no "diff" UI options */
rev.abbrev = 0;
argc = setup_revisions(argc, argv, &rev, NULL);
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index b6106685942e3cb3a5db2b3a67123b5bd554d856..8957b459dee007c51c22e581c2ed7ef0b13b4e7e 100644 (file)
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
static struct rev_info *opt = &log_tree_opt;
int read_stdin = 0;
+ init_revisions(opt);
git_config(git_default_config); /* no "diff" UI options */
nr_sha1 = 0;
- init_revisions(opt);
opt->abbrev = 0;
opt->diff = 1;
argc = setup_revisions(argc, argv, opt, NULL);
diff --git a/builtin-diff.c b/builtin-diff.c
index cb38f445611735cff5bc9fbafb3189e6ccc6c2fd..7d5ad6271e8bdca5a70e8463d98663c41bbd879b 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
* Other cases are errors.
*/
- git_config(git_diff_ui_config);
init_revisions(&rev);
+ git_config(git_diff_ui_config);
+ diff_setup(&rev.diffopt);
argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format) {
diff --git a/builtin-log.c b/builtin-log.c
index 4052cc75bdb2e3915ff17af4d1dc59a3f84f99dd..88c835acba66dc9bca31c8cd33d5425289ade5ca 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
{
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;
{
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;
{
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);