1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 00:56:29 +02:00
git/rev-list.c
Daniel Barkalow 58e28af6a4 [PATCH] Allow multiple date-ordered lists
Make pop_most_recent_commit() return the same objects multiple times, but only
if called with different bits to mark.

This is necessary to make merge-base work again.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 20:29:22 -07:00

24 lines
527 B
C

#include "cache.h"
#include "commit.h"
int main(int argc, char **argv)
{
unsigned char sha1[20];
struct commit_list *list = NULL;
struct commit *commit;
if (argc != 2 || get_sha1_hex(argv[1], sha1))
usage("rev-list <commit-id>");
commit = lookup_commit(sha1);
if (!commit || parse_commit(commit) < 0)
die("bad commit object");
commit_list_insert(commit, &list);
do {
struct commit *commit = pop_most_recent_commit(&list, 0x1);
printf("%s\n", sha1_to_hex(commit->object.sha1));
} while (list);
return 0;
}