4 int main(int argc, char **argv)
6 unsigned char sha1[20];
7 struct commit_list *list = NULL;
10 if (argc != 2 || get_sha1_hex(argv[1], sha1))
11 usage("rev-list <commit-id>");
13 commit = lookup_commit(sha1);
14 if (!commit || parse_commit(commit) < 0)
15 die("bad commit object");
17 commit_list_insert(commit, &list);
19 struct commit *commit = pop_most_recent_commit(&list);
20 printf("%s\n", sha1_to_hex(commit->object.sha1));