Re: [PATCH v4 2/7] ref-filter: add function to print single ref_array_item
From: Jeff King <hidden>
Date: 2016-10-19 15:41:54
On Wed, Oct 19, 2016 at 04:55:43AM -0400, Jeff King wrote:
quoted
diff --git a/ref-filter.h b/ref-filter.h index 14d435e..3d23090 100644 --- a/ref-filter.h +++ b/ref-filter.h@@ -107,4 +107,7 @@ struct ref_sorting *ref_default_sorting(void); /* Function to parse --merged and --no-merged options */ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset); +void pretty_print_ref(const char *name, const unsigned char *sha1, + const char *format, unsigned kind); +What are the possible values for "kind"? I guess these should come from FILTER_REFS_TAGS, BRANCHES, etc. It's probably worth documenting that. Alternatively, is it possible to just determine this from the name? It looks like filter_ref_kind() is how it happens for a normal ref-filter.
I guess that may complicate things for the caller you add in this
series, which may not have a fully-qualified refname (which is obviously
how filter_ref_kind() figures it out). I'd argue that is a bug, though,
as things like "%(refname)" are generally expected to print out the
fully refname ("git tag --format=%(refname)" does so, and you can use
"%(refname:short)" if you want the shorter part).
-Peff