pretty: allow tweaking tabwidth in --expand-tabs
[gitweb.git] / revision.c
index da53b6ce35841c03a541141165fb49297bf68c27..47e9ee7a14060b7848436ee0049b12ccf2378180 100644 (file)
@@ -1415,7 +1415,7 @@ void init_revisions(struct rev_info *revs, const char *prefix)
        revs->expand_tabs_in_log = -1;
 
        revs->commit_format = CMIT_FMT_DEFAULT;
-       revs->expand_tabs_in_log_default = 1;
+       revs->expand_tabs_in_log_default = 8;
 
        init_grep_defaults();
        grep_init(&revs->grep_filter, prefix);
@@ -1918,9 +1918,14 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
                revs->pretty_given = 1;
                get_commit_format(arg+9, revs);
        } else if (!strcmp(arg, "--expand-tabs")) {
-               revs->expand_tabs_in_log = 1;
+               revs->expand_tabs_in_log = 8;
        } else if (!strcmp(arg, "--no-expand-tabs")) {
                revs->expand_tabs_in_log = 0;
+       } else if (skip_prefix(arg, "--expand-tabs=", &arg)) {
+               int val;
+               if (strtol_i(arg, 10, &val) < 0 || val < 0)
+                       die("'%s': not a non-negative integer", arg);
+               revs->expand_tabs_in_log = val;
        } else if (!strcmp(arg, "--show-notes") || !strcmp(arg, "--notes")) {
                revs->show_notes = 1;
                revs->show_notes_given = 1;