summaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-06 10:25:04 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-06 10:25:04 -0700
commitd2d02a490669320054065556a61c44b9ac851a07 (patch)
tree2ead3841b087917e0953ebb858754bc3681d6aef /rev-list.c
parentab580acea4b1b79daaca0c8727b810073a610e2a (diff)
downloadgit-d2d02a490669320054065556a61c44b9ac851a07.tar.gz
Add "--topo-order" flag to use new topological sort
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/rev-list.c b/rev-list.c
index e4d167c003..f41adebd8a 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -39,6 +39,7 @@ static enum cmit_fmt commit_format = CMIT_FMT_RAW;
static int merge_order = 0;
static int show_breaks = 0;
static int stop_traversal = 0;
+static int topo_order = 0;
static void show_commit(struct commit *commit)
{
@@ -474,6 +475,10 @@ int main(int argc, char **argv)
show_breaks = 1;
continue;
}
+ if (!strcmp(arg, "--topo-order")) {
+ topo_order = 1;
+ continue;
+ }
flags = 0;
if (*arg == '^') {
@@ -495,6 +500,8 @@ int main(int argc, char **argv)
if (!merge_order) {
if (limited)
list = limit_list(list);
+ if (topo_order)
+ sort_in_topological_order(&list);
show_commit_list(list);
} else {
if (sort_list_in_merge_order(list, &process_commit)) {