" ordering output:\n"
" --merge-order [ --show-breaks ]\n"
" --topo-order\n"
+" --date-order\n"
" formatting output:\n"
" --parents\n"
" --objects\n"
" --unpacked\n"
" --header | --pretty\n"
+" --abbrev=nr | --no-abbrev\n"
" special purpose:\n"
" --bisect"
;
static int tree_objects = 0;
static int blob_objects = 0;
static int verbose_header = 0;
+static int abbrev = DEFAULT_ABBREV;
static int show_parents = 0;
static int hdr_termination = 0;
static const char *commit_prefix = "";
static int show_breaks = 0;
static int stop_traversal = 0;
static int topo_order = 0;
+static int lifo = 1;
static int no_merges = 0;
static const char **paths = NULL;
static int remove_empty_trees = 0;
if (verbose_header) {
static char pretty_header[16384];
- pretty_print_commit(commit_format, commit, ~0, pretty_header, sizeof(pretty_header), 0);
+ pretty_print_commit(commit_format, commit, ~0, pretty_header, sizeof(pretty_header), abbrev);
printf("%s%c", pretty_header, hdr_termination);
}
fflush(stdout);
verbose_header = 1;
continue;
}
+ if (!strcmp(arg, "--no-abbrev")) {
+ abbrev = 0;
+ continue;
+ }
+ if (!strncmp(arg, "--abbrev=", 9)) {
+ abbrev = strtoul(arg + 9, NULL, 10);
+ if (abbrev && abbrev < MINIMUM_ABBREV)
+ abbrev = MINIMUM_ABBREV;
+ else if (40 < abbrev)
+ abbrev = 40;
+ continue;
+ }
if (!strncmp(arg, "--pretty", 8)) {
commit_format = get_commit_format(arg+8);
verbose_header = 1;
}
if (!strcmp(arg, "--topo-order")) {
topo_order = 1;
+ lifo = 1;
+ limited = 1;
+ continue;
+ }
+ if (!strcmp(arg, "--date-order")) {
+ topo_order = 1;
+ lifo = 0;
limited = 1;
continue;
}
if (limited)
list = limit_list(list);
if (topo_order)
- sort_in_topological_order(&list);
+ sort_in_topological_order(&list, lifo);
show_commit_list(list);
} else {
#ifndef NO_OPENSSL