]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
ref-filter: abstract ref format into its own struct
authorJeff King <peff@peff.net>
Thu, 13 Jul 2017 15:01:18 +0000 (11:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jul 2017 19:42:50 +0000 (12:42 -0700)
commit4a68e36d7d106abaf44e3ac960276145b5a25723
treee31869cd9a8b21809edc0e7fd77f9f133283da7f
parent51331aad69a1d89a8b6d1ff82bb5fedbdb6ccc6a
ref-filter: abstract ref format into its own struct

The ref-filter module provides routines for formatting a ref
for output. The fundamental interface for the format is a
"const char *" containing the format, and any additional
options need to be passed to each invocation of
show_ref_array_item.

Instead, let's make a ref_format struct that holds the
format, along with any associated format options. That will
make some enhancements easier in the future:

  1. new formatting options can be added without disrupting
     existing callers

  2. some state can be carried in the struct rather than as
     global variables

For now this just has the text format itself along with the
quote_style option, but we'll add more fields in future patches.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c
builtin/for-each-ref.c
builtin/tag.c
builtin/verify-tag.c
ref-filter.c
ref-filter.h