diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-26 22:55:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-26 22:55:04 -0700 |
commit | 06cf4f2d87d670f6d49c208fa41933941205da90 (patch) | |
tree | 6f140af0079107fb72d9d986b7eb0ad447edc1dc /trailer.h | |
parent | bfd91b41341cb922aa1ba6e7c01ccd5ebb81cf41 (diff) | |
parent | 5a0d0c037cc187a6eee6329206b9f6a48746a054 (diff) | |
download | git-06cf4f2d87d670f6d49c208fa41933941205da90.tar.gz |
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.h | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -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 */ |