@matheusbsbs / matheus-bagliano / commits / 5ec11af61d
Fork 0

reorder ALLOW_TEXTCONV option setting

Right now for the diff porcelain and the log family, we call: init_revisions(); setup_revisions(); DIFF_OPT_SET(ALLOW_TEXTCONV); However, that means textconv will _always_ be on, instead of being a default that can be manipulated with setup_revisions. Instead, we want: init_revisions(); DIFF_OPT_SET(ALLOW_TEXTCONV); setup_revisions(); which is what this patch does. We'll go ahead and move the callsite in wt-status, also; even though the user can't pass any options here, it is a cleanup that will help avoid any surprise later if the setup_revisions line is changed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Dec 7, 2008 at 21:54 UTC 5ec11af61d907311e4e1b21e10009b06dc2cf74a
3 files changed +4 -4
builtin-diff.c
+2 -2
@@ -290,8 +290,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
290 /* Otherwise, we are doing the usual "git" diff */
291 rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
292
293 - /* Default to let external be used */
293 + /* Default to let external and textconv be used */
294 DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
295 + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
296
297 if (nongit)
298 die("Not a git repository");
@@ -303,7 +304,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
304 }
305
306 DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
306 - DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
307
308 /*
309 * If the user asked for our exit code then don't start a
builtin-log.c
+1 -1
@@ -37,6 +37,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
37 DIFF_OPT_SET(&rev->diffopt, RECURSIVE);
38 rev->show_root_diff = default_show_root;
39 rev->subject_prefix = fmt_patch_subject_prefix;
40 + DIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV);
41
42 if (default_date_mode)
43 rev->date_mode = parse_date_format(default_date_mode);
@@ -60,7 +61,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
61 } else
62 die("unrecognized argument: %s", arg);
63 }
63 - DIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV);
64 }
65
66 /*
wt-status.c
+1 -1
@@ -279,11 +279,11 @@ static void wt_status_print_verbose(struct wt_status *s)
279 struct rev_info rev;
280
281 init_revisions(&rev, NULL);
282 + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
283 setup_revisions(0, NULL, &rev,
284 s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
285 rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
286 rev.diffopt.detect_rename = 1;
286 - DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
287 rev.diffopt.file = s->fp;
288 rev.diffopt.close_file = 0;
289 /*