summaryrefslogtreecommitdiff
path: root/trailer.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-27 05:55:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-27 05:55:04 (GMT)
commit06cf4f2d87d670f6d49c208fa41933941205da90 (patch)
tree6f140af0079107fb72d9d986b7eb0ad447edc1dc /trailer.h
parentbfd91b41341cb922aa1ba6e7c01ccd5ebb81cf41 (diff)
parent5a0d0c037cc187a6eee6329206b9f6a48746a054 (diff)
downloadgit-06cf4f2d87d670f6d49c208fa41933941205da90.zip
git-06cf4f2d87d670f6d49c208fa41933941205da90.tar.gz
git-06cf4f2d87d670f6d49c208fa41933941205da90.tar.bz2
Merge branch 'jk/trailers-parse'
"git interpret-trailers" has been taught a "--parse" and a few other options to make it easier for scripts to grab existing trailer lines from a commit log message. * jk/trailers-parse: doc/interpret-trailers: fix "the this" typo pretty: support normalization options for %(trailers) t4205: refactor %(trailers) tests pretty: move trailer formatting to trailer.c interpret-trailers: add --parse convenience option interpret-trailers: add an option to unfold values interpret-trailers: add an option to show only existing trailers interpret-trailers: add an option to show only the trailers trailer: put process_trailers() options into a struct
Diffstat (limited to 'trailer.h')
-rw-r--r--trailer.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/trailer.h b/trailer.h
index 973b533..6d7f8c2 100644
--- a/trailer.h
+++ b/trailer.h
@@ -63,11 +63,36 @@ struct new_trailer_item {
enum trailer_if_missing if_missing;
};
-void process_trailers(const char *file, int in_place, int trim_empty,
+struct process_trailer_options {
+ int in_place;
+ int trim_empty;
+ int only_trailers;
+ int only_input;
+ int unfold;
+};
+
+#define PROCESS_TRAILER_OPTIONS_INIT {0}
+
+void process_trailers(const char *file,
+ const struct process_trailer_options *opts,
struct list_head *new_trailer_head);
void trailer_info_get(struct trailer_info *info, const char *str);
void trailer_info_release(struct trailer_info *info);
+/*
+ * Format the trailers from the commit msg "msg" into the strbuf "out".
+ * Note two caveats about "opts":
+ *
+ * - this is primarily a helper for pretty.c, and not
+ * all of the flags are supported.
+ *
+ * - this differs from process_trailers slightly in that we always format
+ * only the trailer block itself, even if the "only_trailers" option is not
+ * set.
+ */
+void format_trailers_from_commit(struct strbuf *out, const char *msg,
+ const struct process_trailer_options *opts);
+
#endif /* TRAILER_H */