diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:37 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:37 -0700 |
| commit | bda891e6647538693d6cec5d3085f1508fbb5f5f (patch) | |
| tree | 70992fb2e373ecd84fb5923b76c44aa83aeba532 /ref-filter.h | |
| parent | 5c933f0155959452f299cd4a0a65fe22b5c239be (diff) | |
| parent | b9dee075eb07713a49922f7e1f90a6a9de5c5e5f (diff) | |
| download | git-bda891e6647538693d6cec5d3085f1508fbb5f5f.tar.xz | |
Merge branch 'zh/ref-filter-raw-data'
Prepare the "ref-filter" machinery that drives the "--format"
option of "git for-each-ref" and its friends to be used in "git
cat-file --batch".
* zh/ref-filter-raw-data:
ref-filter: add %(rest) atom
ref-filter: use non-const ref_format in *_atom_parser()
ref-filter: --format=%(raw) support --perl
ref-filter: add %(raw) atom
ref-filter: add obj-type check in grab contents
Diffstat (limited to 'ref-filter.h')
| -rw-r--r-- | ref-filter.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ref-filter.h b/ref-filter.h index baf72a7189..c15dee8d6b 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -38,6 +38,7 @@ struct ref_sorting { struct ref_array_item { struct object_id objectname; + const char *rest; int flag; unsigned int kind; const char *symref; @@ -76,14 +77,16 @@ struct ref_format { * verify_ref_format() afterwards to finalize. */ const char *format; + const char *rest; int quote_style; + int use_rest; int use_color; /* Internal state to ref-filter */ int need_color_reset_at_eol; }; -#define REF_FORMAT_INIT { NULL, 0, -1 } +#define REF_FORMAT_INIT { .use_color = -1 } /* Macros for checking --merged and --no-merged options */ #define _OPT_MERGED_NO_MERGED(option, filter, h) \ @@ -116,7 +119,7 @@ void ref_array_sort(struct ref_sorting *sort, struct ref_array *array); void ref_sorting_set_sort_flags_all(struct ref_sorting *sorting, unsigned int mask, int on); /* Based on the given format and quote_style, fill the strbuf */ int format_ref_array_item(struct ref_array_item *info, - const struct ref_format *format, + struct ref_format *format, struct strbuf *final_buf, struct strbuf *error_buf); /* Parse a single sort specifier and add it to the list */ @@ -137,7 +140,7 @@ void setup_ref_filter_porcelain_msg(void); * name must be a fully qualified refname. */ void pretty_print_ref(const char *name, const struct object_id *oid, - const struct ref_format *format); + struct ref_format *format); /* * Push a single ref onto the array; this can be used to construct your own |
