4 static const char missing_revs_usage
[] =
5 "git-missing-revs <rev-cache-file> <want-sha1>...";
10 static void process(struct rev_cache
*head_list
)
13 struct rev_cache
*rc
= head_list
;
14 struct rev_list_elem
*e
;
15 head_list
= rc
->head_list
;
17 if (has_sha1_file(rc
->sha1
)) {
21 if (rc
->work
& (REV_WANT
|REV_HAVE
))
24 printf("%s\n", sha1_to_hex(rc
->sha1
));
25 for (e
= rc
->parents
; e
; e
= e
->next
) {
26 if (e
->ri
->work
& REV_HAVE
)
28 e
->ri
->head_list
= head_list
;
34 int main(int ac
, char **av
)
36 const char *rev_cache_file
;
37 struct rev_cache
*head_list
= NULL
;
41 usage(missing_revs_usage
);
42 rev_cache_file
= av
[1];
43 read_rev_cache(rev_cache_file
, NULL
, 0);
44 for (i
= 2; i
< ac
; i
++) {
45 unsigned char sha1
[20];
48 if (get_sha1_hex(av
[i
], sha1
))
49 die("%s: not an SHA1", av
[i
]);
50 if ((pos
= find_rev_cache(sha1
)) < 0) {
51 /* We could be asked for tags, which would not
52 * appear in the rev-cache.
58 rc
->head_list
= head_list
;