]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
ref-filter: add multiple-option parsing functions
authorKousik Sanagavarapu <five231003@gmail.com>
Sun, 23 Jul 2023 16:19:58 +0000 (21:49 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jul 2023 16:55:00 +0000 (09:55 -0700)
commitf46094a5e6b80098786b4e1448be032dfbdf3f43
tree5da0f80dd41d7498548ba632c54501c14921e6ef
parentcba07a324d2cda06dd7a7b35b4579f800de024aa
ref-filter: add multiple-option parsing functions

The functions

match_placeholder_arg_value()
match_placeholder_bool_arg()

were added in pretty 4f732e0fd7 (pretty: allow %(trailers) options
with explicit value, 2019-01-29) to parse multiple options in an
argument to --pretty. For example,

git log --pretty="%(trailers:key=Signed-Off-By,separator=%x2C )"

will output all the trailers matching the key and seperates them by
a comma followed by a space per commit.

Add similar functions,

match_atom_arg_value()
match_atom_bool_arg()

in ref-filter.

There is no atom yet that can use these functions in ref-filter, but we
are going to add a new %(describe) atom in a subsequent commit where we
parse options like tags=<bool-value> or match=<pattern> given to it.

Helped-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c