Skip to content

Commit

Permalink
Clean up commit insertion in git-rev-list
Browse files Browse the repository at this point in the history
Jon wants the commits in a different order for merge-order.
  • Loading branch information
Linus Torvalds committed Jul 6, 2005
1 parent f755494 commit 7e21c29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,10 @@ 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];
Expand Down Expand Up @@ -464,6 +466,7 @@ int main(int argc, char **argv)
}
if (!strcmp(arg, "--merge-order")) {
merge_order = 1;
insert = commit_list_insert;
continue;
}
if (!strcmp(arg, "--show-breaks")) {
Expand All @@ -482,7 +485,7 @@ int main(int argc, char **argv)
commit = get_commit_reference(arg, flags);
if (!commit)
continue;
insert_by_date(commit, &list);
insert(commit, &list);
}

if (!merge_order) {
Expand Down

0 comments on commit 7e21c29

Please sign in to comment.