summaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-16 06:05:33 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-16 06:12:06 (GMT)
commit4c8725f16abff4be4812d0d07a663250bef3ef0e (patch)
treeb71f712e939c935fa1cbb0d5f96c8d2ee4af6b73 /rev-list.c
parentbe97bd1b88003f4a19e2832ee0cc6ac20fcab674 (diff)
downloadgit-4c8725f16abff4be4812d0d07a663250bef3ef0e.zip
git-4c8725f16abff4be4812d0d07a663250bef3ef0e.tar.gz
git-4c8725f16abff4be4812d0d07a663250bef3ef0e.tar.bz2
topo-order: make --date-order optional.
This adds --date-order to rev-list; it is similar to topo order in the sense that no parent comes before all of its children, but otherwise things are still ordered in the commit timestamp order. The same flag is also added to show-branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/rev-list.c b/rev-list.c
index 63391fc..f2d1105 100644
--- a/rev-list.c
+++ b/rev-list.c
@@ -27,6 +27,7 @@ static const char rev_list_usage[] =
" ordering output:\n"
" --merge-order [ --show-breaks ]\n"
" --topo-order\n"
+" --date-order\n"
" formatting output:\n"
" --parents\n"
" --objects\n"
@@ -56,6 +57,7 @@ static int merge_order = 0;
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;
@@ -856,6 +858,13 @@ int main(int argc, const char **argv)
}
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;
}
@@ -940,7 +949,7 @@ int main(int argc, const char **argv)
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