THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5KB

  1. #ifndef NOTES_UTILS_H
  2. #define NOTES_UTILS_H
  3. #include "notes.h"
  4. struct commit_list;
  5. struct object_id;
  6. struct repository;
  7. /*
  8. * Create new notes commit from the given notes tree
  9. *
  10. * Properties of the created commit:
  11. * - tree: the result of converting t to a tree object with write_notes_tree().
  12. * - parents: the given parents OR (if NULL) the commit referenced by t->ref.
  13. * - author/committer: the default determined by commit_tree().
  14. * - commit message: msg
  15. *
  16. * The resulting commit SHA1 is stored in result_sha1.
  17. */
  18. void create_notes_commit(struct repository *r,
  19. struct notes_tree *t,
  20. struct commit_list *parents,
  21. const char *msg, size_t msg_len,
  22. struct object_id *result_oid);
  23. void commit_notes(struct repository *r, struct notes_tree *t, const char *msg);
  24. enum notes_merge_strategy {
  25. NOTES_MERGE_RESOLVE_MANUAL = 0,
  26. NOTES_MERGE_RESOLVE_OURS,
  27. NOTES_MERGE_RESOLVE_THEIRS,
  28. NOTES_MERGE_RESOLVE_UNION,
  29. NOTES_MERGE_RESOLVE_CAT_SORT_UNIQ
  30. };
  31. struct notes_rewrite_cfg {
  32. struct notes_tree **trees;
  33. const char *cmd;
  34. int enabled;
  35. combine_notes_fn combine;
  36. struct string_list *refs;
  37. int refs_from_env;
  38. int mode_from_env;
  39. };
  40. int parse_notes_merge_strategy(const char *v, enum notes_merge_strategy *s);
  41. struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd);
  42. int copy_note_for_rewrite(struct notes_rewrite_cfg *c,
  43. const struct object_id *from_obj, const struct object_id *to_obj);
  44. void finish_copy_notes_for_rewrite(struct repository *r,
  45. struct notes_rewrite_cfg *c,
  46. const char *msg);
  47. #endif