X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=rev-list.c;h=c60aa72957cb65501266911aefd8aaaa2f2e4e16;hb=d1c5f2a42d7b5c0e3d3862212dea1f09809c4963;hp=5ec9ccb6036bf79276f50fa13bd3cf9398c859f3;hpb=c807f771947de65dceb22960d1a093d702f42105;p=git.git diff --git a/rev-list.c b/rev-list.c index 5ec9ccb6..c60aa729 100644 --- a/rev-list.c +++ b/rev-list.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "refs.h" #include "tag.h" #include "commit.h" #include "tree.h" @@ -489,6 +490,22 @@ static void handle_one_commit(struct commit *com, struct commit_list **lst) commit_list_insert(com, lst); } +/* for_each_ref() callback does not allow user data -- Yuck. */ +static struct commit_list **global_lst; + +static int include_one_commit(const char *path, const unsigned char *sha1) +{ + struct commit *com = get_commit_reference(path, 0); + handle_one_commit(com, global_lst); + return 0; +} + +static void handle_all(struct commit_list **lst) +{ + global_lst = lst; + for_each_ref(include_one_commit); + global_lst = NULL; +} int main(int argc, char **argv) { @@ -542,6 +559,10 @@ int main(int argc, char **argv) bisect_list = 1; continue; } + if (!strcmp(arg, "--all")) { + handle_all(&list); + continue; + } if (!strcmp(arg, "--objects")) { tag_objects = 1; tree_objects = 1;