diff options
author | Andy Koppe <andy.koppe@gmail.com> | 2023-08-20 20:50:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-08-21 20:40:10 +0200 |
commit | f1f8a258567268974b9bbd012c33ad219a31aa0e (patch) | |
tree | bcd9ee55e4bb42eff9a588313bef32193d15cf5e /pretty.c | |
parent | pretty: add %(decorate[:<options>]) format (diff) | |
download | git-f1f8a258567268974b9bbd012c33ad219a31aa0e.tar.xz git-f1f8a258567268974b9bbd012c33ad219a31aa0e.zip |
pretty: add pointer and tag options to %(decorate)
Add pointer and tag options to %(decorate) format, to allow to override
the " -> " string used to show where HEAD points and the "tag: " string
used to mark tags.
Document in pretty-formats.txt and test in t4205-log-pretty-formats.sh.
Signed-off-by: Andy Koppe <andy.koppe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1407,7 +1407,9 @@ static void parse_decoration_options(const char **arg, { while (parse_decoration_option(arg, "prefix", &opts->prefix) || parse_decoration_option(arg, "suffix", &opts->suffix) || - parse_decoration_option(arg, "separator", &opts->separator)) + parse_decoration_option(arg, "separator", &opts->separator) || + parse_decoration_option(arg, "pointer", &opts->pointer) || + parse_decoration_option(arg, "tag", &opts->tag)) ; } @@ -1416,6 +1418,8 @@ static void free_decoration_options(const struct decoration_options *opts) free(opts->prefix); free(opts->suffix); free(opts->separator); + free(opts->pointer); + free(opts->tag); } static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ |