aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-06 14:53:06 -0800
committerJunio C Hamano <gitster@pobox.com>2012-03-06 14:53:06 -0800
commitaf050219e44051426179248614a046896b5d40c0 (patch)
tree5f778353648283755312ad61f26aa6f1c3759601 /builtin
parent556c5e030f17efb412a192a430fe9027840ed718 (diff)
parentdf44483a5dde62f4b49c80fd90d7fe12ddcfb084 (diff)
downloadgit-af050219e44051426179248614a046896b5d40c0.tar.gz
git-af050219e44051426179248614a046896b5d40c0.tar.xz
Merge branch 'zj/diff-stat-dyncol'
By Zbigniew Jędrzejewski-Szmek (8) and Junio C Hamano (1) * zj/diff-stat-dyncol: : This breaks tests. Perhaps it is not worth using the decimal-width stuff : for this series, at least initially. diff --stat: add config option to limit graph width diff --stat: enable limiting of the graph part diff --stat: add a test for output with COLUMNS=40 diff --stat: use a maximum of 5/8 for the filename part merge --stat: use the full terminal width log --stat: use the full terminal width show --stat: use the full terminal width diff --stat: use the full terminal width diff --stat: tests for long filenames and big change counts
Diffstat (limited to 'builtin')
-rw-r--r--builtin/diff.c4
-rw-r--r--builtin/log.c4
-rw-r--r--builtin/merge.c2
3 files changed, 10 insertions, 0 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 387afa756..424c815f9 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -285,6 +285,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
/* Otherwise, we are doing the usual "git" diff */
rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
+ /* Scale to real terminal size and respect statGraphWidth config */
+ rev.diffopt.stat_width = -1;
+ rev.diffopt.stat_graph_width = -1;
+
/* Default to let external and textconv be used */
DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
diff --git a/builtin/log.c b/builtin/log.c
index 7d1f6f88a..8a47012b0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -77,6 +77,8 @@ static void cmd_log_init_defaults(struct rev_info *rev)
get_commit_format(fmt_pretty, rev);
rev->verbose_header = 1;
DIFF_OPT_SET(&rev->diffopt, RECURSIVE);
+ rev->diffopt.stat_width = -1; /* use full terminal width */
+ rev->diffopt.stat_graph_width = -1; /* respect statGraphWidth config */
rev->abbrev_commit = default_abbrev_commit;
rev->show_root_diff = default_show_root;
rev->subject_prefix = fmt_patch_subject_prefix;
@@ -447,6 +449,8 @@ int cmd_show(int argc, const char **argv, const char *prefix)
rev.diff = 1;
rev.always_show_header = 1;
rev.no_walk = 1;
+ rev.diffopt.stat_width = -1; /* Scale to real terminal size */
+
memset(&opt, 0, sizeof(opt));
opt.def = "HEAD";
opt.tweak = show_rev_tweak_rev;
diff --git a/builtin/merge.c b/builtin/merge.c
index d3e1e8dc9..cb8f14910 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -399,6 +399,8 @@ static void finish(struct commit *head_commit,
if (new_head && show_diffstat) {
struct diff_options opts;
diff_setup(&opts);
+ opts.stat_width = -1; /* use full terminal width */
+ opts.stat_graph_width = -1; /* respect statGraphWidth config */
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;