summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a610786)
raw | patch | inline | side by side (parent: a610786)
author | Timo Hirvonen <tihirvon@gmail.com> | |
Sat, 24 Jun 2006 17:24:14 +0000 (20:24 +0300) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 26 Jun 2006 21:58:40 +0000 (14:58 -0700) |
Initialize output_format to 0 instead of DIFF_FORMAT_RAW so that we can see
later if any command line options changed it. Default value is set only if
output format was not specified.
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
later if any command line options changed it. Default value is set only if
output format was not specified.
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/builtin-diff-files.c b/builtin-diff-files.c
index 5afc1d7208f8a13b7363be2127cad3b43baa95dd..a655eea91ed5ac38af578e47fe6747a1b6fb968c 100644 (file)
--- a/builtin-diff-files.c
+++ b/builtin-diff-files.c
usage(diff_files_usage);
argv++; argc--;
}
+ if (!rev.diffopt.output_format)
+ rev.diffopt.output_format = DIFF_FORMAT_RAW;
+
/*
* Make sure there are NO revision (i.e. pending object) parameter,
* rev.max_count is reasonable (0 <= n <= 3),
diff --git a/builtin-diff-index.c b/builtin-diff-index.c
index c42ef9a7a76e7d8f6bc25d593865b9343d4e74b5..b37c9e8ccb30686810ecfdb898ad360b40ca0723 100644 (file)
--- a/builtin-diff-index.c
+++ b/builtin-diff-index.c
else
usage(diff_cache_usage);
}
+ if (!rev.diffopt.output_format)
+ rev.diffopt.output_format = DIFF_FORMAT_RAW;
+
/*
* Make sure there is one revision (i.e. pending object),
* and there is no revision filtering parameters.
diff --git a/builtin-diff-stages.c b/builtin-diff-stages.c
index 7c157ca889eaf85b38be2764fca83814bb83a3f4..30931fe0498753ed3a7f68be064027391a82e677 100644 (file)
--- a/builtin-diff-stages.c
+++ b/builtin-diff-stages.c
ac--; av++;
}
+ if (!diff_options.output_format)
+ diff_options.output_format = DIFF_FORMAT_RAW;
+
if (ac < 3 ||
sscanf(av[1], "%d", &stage1) != 1 ||
! (0 <= stage1 && stage1 <= 3) ||
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index 3409a39a9f73f9ed67547f5cc79619c1e402f47b..ae1cde9d005cb64ca2b1a5de45750abff04d444d 100644 (file)
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
usage(diff_tree_usage);
}
+ if (!opt->diffopt.output_format)
+ opt->diffopt.output_format = DIFF_FORMAT_RAW;
+
/*
* NOTE! We expect "a ^b" to be equal to "a..b", so we
* reverse the order of the objects if the second one
diff --git a/builtin-diff.c b/builtin-diff.c
index 91235a118a3878c0d0445a741ce3182c11cdf705..47e0a37e212d9a7085714d1b5d6d8f2ffda8d5a6 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
git_config(git_diff_config);
init_revisions(&rev);
- rev.diffopt.output_format = DIFF_FORMAT_PATCH;
argc = setup_revisions(argc, argv, &rev, NULL);
+ if (!rev.diffopt.output_format)
+ rev.diffopt.output_format = DIFF_FORMAT_PATCH;
+
/* Do we have --cached and not have a pending object, then
* default to HEAD by hand. Eek.
*/
diff --git a/builtin-log.c b/builtin-log.c
index e321959c56155289dcdb574aa11279e6f9335122..c1bf9d4ee1d2f0fa5ec362e5364a1e99d587f254 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
rev.diff = 1;
rev.combine_merges = 0;
rev.ignore_merges = 1;
- rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
git_config(git_format_config);
rev.extra_headers = extra_headers;
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);
+ if (!rev.diffopt.output_format)
+ rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
+
if (output_directory) {
if (use_stdout)
die("standard output, or directory, which one?");
index 12f655a2fa389ff8a31d25ecd618c7f7f483c994..928345199d60fef23087f9fba1160c1132263e0f 100644 (file)
--- a/diff.c
+++ b/diff.c
void diff_setup(struct diff_options *options)
{
memset(options, 0, sizeof(*options));
- options->output_format = DIFF_FORMAT_RAW;
options->line_termination = '\n';
options->break_opt = -1;
options->rename_limit = -1;