Skip to content

Commit 90b1994

Browse files
committed
diff: Rename QUIET internal option to QUICK
The option "QUIET" primarily meant "find if we have _any_ difference as quick as possible and report", which means we often do not even have to look at blobs if we know the trees are different by looking at the higher level (e.g. "diff-tree A B"). As a side effect, because there is no point showing one change that we happened to have found first, it also enables NO_OUTPUT and EXIT_WITH_STATUS options, making the end result look quiet. Rename the internal option to QUICK to reflect this better; it also makes grepping the source tree much easier, as there are other kinds of QUIET option everywhere. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f245194 commit 90b1994

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

builtin-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
537537

538538
get_patch_filename(commit, rev->nr, fmt_patch_suffix, &filename);
539539

540-
if (!DIFF_OPT_TST(&rev->diffopt, QUIET))
540+
if (!DIFF_OPT_TST(&rev->diffopt, QUICK))
541541
fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
542542

543543
if (freopen(filename.buf, "w", stdout) == NULL)

builtin-rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
320320
memset(&info, 0, sizeof(info));
321321
info.revs = &revs;
322322

323-
quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
323+
quiet = DIFF_OPT_TST(&revs.diffopt, QUICK);
324324
for (i = 1 ; i < argc; i++) {
325325
const char *arg = argv[i];
326326

diff-lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
7373
struct cache_entry *ce = active_cache[i];
7474
int changed;
7575

76-
if (DIFF_OPT_TST(&revs->diffopt, QUIET) &&
76+
if (DIFF_OPT_TST(&revs->diffopt, QUICK) &&
7777
DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
7878
break;
7979

@@ -523,7 +523,7 @@ int index_differs_from(const char *def, int diff_flags)
523523

524524
init_revisions(&rev, NULL);
525525
setup_revisions(0, NULL, &rev, def);
526-
DIFF_OPT_SET(&rev.diffopt, QUIET);
526+
DIFF_OPT_SET(&rev.diffopt, QUICK);
527527
DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
528528
rev.diffopt.flags |= diff_flags;
529529
run_diff_index(&rev, 1);

diff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ int diff_setup_done(struct diff_options *options)
24522452
* to have found. It does not make sense not to return with
24532453
* exit code in such a case either.
24542454
*/
2455-
if (DIFF_OPT_TST(options, QUIET)) {
2455+
if (DIFF_OPT_TST(options, QUICK)) {
24562456
options->output_format = DIFF_FORMAT_NO_OUTPUT;
24572457
DIFF_OPT_SET(options, EXIT_WITH_STATUS);
24582458
}
@@ -2643,7 +2643,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
26432643
else if (!strcmp(arg, "--exit-code"))
26442644
DIFF_OPT_SET(options, EXIT_WITH_STATUS);
26452645
else if (!strcmp(arg, "--quiet"))
2646-
DIFF_OPT_SET(options, QUIET);
2646+
DIFF_OPT_SET(options, QUICK);
26472647
else if (!strcmp(arg, "--ext-diff"))
26482648
DIFF_OPT_SET(options, ALLOW_EXTERNAL);
26492649
else if (!strcmp(arg, "--no-ext-diff"))

diff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
5555
#define DIFF_OPT_COLOR_DIFF (1 << 8)
5656
#define DIFF_OPT_COLOR_DIFF_WORDS (1 << 9)
5757
#define DIFF_OPT_HAS_CHANGES (1 << 10)
58-
#define DIFF_OPT_QUIET (1 << 11)
58+
#define DIFF_OPT_QUICK (1 << 11)
5959
#define DIFF_OPT_NO_INDEX (1 << 12)
6060
#define DIFF_OPT_ALLOW_EXTERNAL (1 << 13)
6161
#define DIFF_OPT_EXIT_WITH_STATUS (1 << 14)

revision.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ void init_revisions(struct rev_info *revs, const char *prefix)
791791
revs->ignore_merges = 1;
792792
revs->simplify_history = 1;
793793
DIFF_OPT_SET(&revs->pruning, RECURSIVE);
794-
DIFF_OPT_SET(&revs->pruning, QUIET);
794+
DIFF_OPT_SET(&revs->pruning, QUICK);
795795
revs->pruning.add_remove = file_add_remove;
796796
revs->pruning.change = file_change;
797797
revs->lifo = 1;

tree-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, stru
286286
int baselen = strlen(base);
287287

288288
for (;;) {
289-
if (DIFF_OPT_TST(opt, QUIET) &&
289+
if (DIFF_OPT_TST(opt, QUICK) &&
290290
DIFF_OPT_TST(opt, HAS_CHANGES))
291291
break;
292292
if (opt->nr_paths) {

0 commit comments

Comments
 (0)