summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7647b17)
raw | patch | inline | side by side (parent: 7647b17)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Tue, 14 Aug 2007 22:41:00 +0000 (00:41 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 15 Aug 2007 05:34:58 +0000 (22:34 -0700) |
When we compare two non-tracked files, or explicitly
specify --no-index, the suggestion to run git-status
is not helpful.
The patch adds a new diff_options bitfield member, no_index, that
is used instead of the special value of -2 of the rev_info field
max_count to indicate that the index is not to be used. This makes
it possible to pass that flag down to diffcore_skip_stat_unmatch(),
which only has one diff_options parameter.
This could even become a cleanup if we removed all assignments of
max_count to a value of -2 (viz. replacement of a magic value with
a self-documenting field name) but I didn't dare to do that so late
in the rc game..
The no_index bit, if set, then tells diffcore_skip_stat_unmatch()
to not account for any skipped stat-mismatches, which avoids the
suggestion to run git-status.
Signed-off-by: Rene Scharfe <rene.scharfe@lsfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
specify --no-index, the suggestion to run git-status
is not helpful.
The patch adds a new diff_options bitfield member, no_index, that
is used instead of the special value of -2 of the rev_info field
max_count to indicate that the index is not to be used. This makes
it possible to pass that flag down to diffcore_skip_stat_unmatch(),
which only has one diff_options parameter.
This could even become a cleanup if we removed all assignments of
max_count to a value of -2 (viz. replacement of a magic value with
a self-documenting field name) but I didn't dare to do that so late
in the rc game..
The no_index bit, if set, then tells diffcore_skip_stat_unmatch()
to not account for any skipped stat-mismatches, which avoids the
suggestion to run git-status.
Signed-off-by: Rene Scharfe <rene.scharfe@lsfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | patch | blob | history | |
diff.c | patch | blob | history | |
diff.h | patch | blob | history |
diff --git a/diff-lib.c b/diff-lib.c
index 92c0e39ad6f21e0511ee84052e2b762d6e447f61..f5568c3b36338a203a42ce1e46109152ad4642bb 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
!strcmp(argv[1], "--no-index")) {
revs->max_count = -2;
revs->diffopt.exit_with_status = 1;
+ revs->diffopt.no_index = 1;
}
else if (!strcmp(argv[1], "-q"))
*silent = 1;
*/
read_cache();
if (!is_in_index(revs->diffopt.paths[0]) ||
- !is_in_index(revs->diffopt.paths[1]))
+ !is_in_index(revs->diffopt.paths[1])) {
revs->max_count = -2;
+ revs->diffopt.no_index = 1;
+ }
}
/*
else
revs->diffopt.paths = argv + argc - 2;
revs->diffopt.nr_paths = 2;
+ revs->diffopt.no_index = 1;
revs->max_count = -2;
return 0;
}
if (handle_diff_files_args(revs, argc, argv, &silent_on_removed))
return -1;
- if (revs->max_count == -2) {
+ if (revs->diffopt.no_index) {
if (revs->diffopt.nr_paths != 2)
return error("need two files/directories with --no-index");
if (queue_diff(&revs->diffopt, revs->diffopt.paths[0],
index f884de77ac2a0175e317628e25ec9ee3aaa902f7..97cc5bc085ba21693007328bb402860420949ec0 100644 (file)
--- a/diff.c
+++ b/diff.c
* to determine how many paths were dirty only
* due to stat info mismatch.
*/
- diffopt->skip_stat_unmatch++;
+ if (!diffopt->no_index)
+ diffopt->skip_stat_unmatch++;
diff_free_filepair(p);
}
}