Add "git-push-script" to make a more regular interface
[gitweb.git] / rev-list.c
index c4a61513438b707c097815b7e0acbcea400f6d79..dfa0933825c5afdcb35e15ee739ba12530fcc9ff 100644 (file)
@@ -9,7 +9,6 @@
 #define INTERESTING    (1u << 1)
 #define COUNTED                (1u << 2)
 #define SHOWN          (1u << 3)
-#define DUPCHECK       (1u << 4)
 
 static const char rev_list_usage[] =
        "usage: git-rev-list [OPTION] commit-id <commit-id>\n"
@@ -411,10 +410,8 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags)
 int main(int argc, char **argv)
 {
        struct commit_list *list = NULL;
-       struct commit_list *(*insert)(struct commit *, struct commit_list **);
        int i, limited = 0;
 
-       insert = insert_by_date;
        for (i = 1 ; i < argc; i++) {
                int flags;
                char *arg = argv[i];
@@ -464,7 +461,6 @@ int main(int argc, char **argv)
                }
                if (!strcmp(arg, "--merge-order")) {
                        merge_order = 1;
-                       insert = commit_list_insert;
                        continue;
                }
                if (!strcmp(arg, "--show-breaks")) {
@@ -473,6 +469,7 @@ int main(int argc, char **argv)
                }
                if (!strcmp(arg, "--topo-order")) {
                        topo_order = 1;
+                       limited = 1;
                        continue;
                }
 
@@ -487,13 +484,14 @@ int main(int argc, char **argv)
                commit = get_commit_reference(arg, flags);
                if (!commit)
                        continue;
-               if (commit->object.flags & DUPCHECK)
+               if (commit->object.flags & SEEN)
                        continue;
-               commit->object.flags |= DUPCHECK;
-               insert(commit, &list);
+               commit->object.flags |= SEEN;
+               commit_list_insert(commit, &list);
        }
 
        if (!merge_order) {             
+               sort_by_date(&list);
                if (limited)
                        list = limit_list(list);
                if (topo_order)