]> git.ipfire.org Git - thirdparty/git.git/blame - patch-ids.h
Documentation/RelNotes/2.45.0.txt: fix typo
[thirdparty/git.git] / patch-ids.h
CommitLineData
5d23e133
JH
1#ifndef PATCH_IDS_H
2#define PATCH_IDS_H
3
ef3ca954
EN
4#include "diff.h"
5#include "hashmap.h"
6
7struct commit;
8struct object_id;
a7edadda 9struct repository;
ef3ca954 10
5d23e133 11struct patch_id {
dfb7a1b4 12 struct hashmap_entry ent;
34f3c0eb 13 struct object_id patch_id;
683f17ec 14 struct commit *commit;
5d23e133
JH
15};
16
17struct patch_ids {
dfb7a1b4 18 struct hashmap patches;
5d23e133 19 struct diff_options diffopts;
5d23e133
JH
20};
21
ded2c097 22int commit_patch_id(struct commit *commit, struct diff_options *options,
51276c18 23 struct object_id *oid, int);
a7edadda 24int init_patch_ids(struct repository *, struct patch_ids *);
5d23e133 25int free_patch_ids(struct patch_ids *);
c9e3a4e7
JK
26
27/* Add a patch_id for a single commit to the set. */
5d23e133 28struct patch_id *add_commit_patch_id(struct commit *, struct patch_ids *);
c9e3a4e7
JK
29
30/* Returns true if the patch-id of "commit" is present in the set. */
31int has_commit_patch_id(struct commit *commit, struct patch_ids *);
32
33/*
34 * Iterate over all commits in the set whose patch id matches that of
35 * "commit", like:
36 *
37 * struct patch_id *cur;
38 * for (cur = patch_id_iter_first(commit, ids);
39 * cur;
40 * cur = patch_id_iter_next(cur, ids) {
41 * ... look at cur->commit
42 * }
43 */
44struct patch_id *patch_id_iter_first(struct commit *commit, struct patch_ids *);
45struct patch_id *patch_id_iter_next(struct patch_id *cur, struct patch_ids *);
5d23e133
JH
46
47#endif /* PATCH_IDS_H */