15 enum trailer_if_exists {
17 EXISTS_ADD_IF_DIFFERENT_NEIGHBOR,
18 EXISTS_ADD_IF_DIFFERENT,
23 enum trailer_if_missing {
29 int trailer_set_where(enum trailer_where *item, const char *value);
30 int trailer_set_if_exists(enum trailer_if_exists *item, const char *value);
31 int trailer_set_if_missing(enum trailer_if_missing *item, const char *value);
35 * True if there is a blank line before the location pointed to by
38 int blank_line_before_trailer;
41 * Pointers to the start and end of the trailer block found. If there
42 * is no trailer block found, these 2 pointers point to the end of the
45 const char *trailer_start, *trailer_end;
48 * Array of trailers found.
55 * A list that represents newly-added trailers, such as those provided
56 * with the --trailer command line option of git-interpret-trailers.
58 struct new_trailer_item {
59 struct list_head list;
63 enum trailer_where where;
64 enum trailer_if_exists if_exists;
65 enum trailer_if_missing if_missing;
68 struct process_trailer_options {
77 #define PROCESS_TRAILER_OPTIONS_INIT {0}
79 void process_trailers(const char *file,
80 const struct process_trailer_options *opts,
81 struct list_head *new_trailer_head);
83 void trailer_info_get(struct trailer_info *info, const char *str,
84 const struct process_trailer_options *opts);
86 void trailer_info_release(struct trailer_info *info);
89 * Format the trailers from the commit msg "msg" into the strbuf "out".
90 * Note two caveats about "opts":
92 * - this is primarily a helper for pretty.c, and not
93 * all of the flags are supported.
95 * - this differs from process_trailers slightly in that we always format
96 * only the trailer block itself, even if the "only_trailers" option is not
99 void format_trailers_from_commit(struct strbuf *out, const char *msg,
100 const struct process_trailer_options *opts);
102 #endif /* TRAILER_H */