diff options
Diffstat (limited to 'ref-filter.h')
-rw-r--r-- | ref-filter.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/ref-filter.h b/ref-filter.h index 1524bc4..0ca28d2 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -3,10 +3,10 @@ #include "gettext.h" #include "oid-array.h" -#include "refs.h" #include "commit.h" #include "string-list.h" #include "strvec.h" +#include "commit-reach.h" /* Quoting styles */ #define QUOTE_NONE 0 @@ -19,10 +19,13 @@ #define FILTER_REFS_BRANCHES 0x0004 #define FILTER_REFS_REMOTES 0x0008 #define FILTER_REFS_OTHERS 0x0010 -#define FILTER_REFS_ALL (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \ +#define FILTER_REFS_REGULAR (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \ FILTER_REFS_REMOTES | FILTER_REFS_OTHERS) #define FILTER_REFS_DETACHED_HEAD 0x0020 -#define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD) +#define FILTER_REFS_PSEUDOREFS 0x0040 +#define FILTER_REFS_ROOT_REFS (FILTER_REFS_DETACHED_HEAD | FILTER_REFS_PSEUDOREFS) +#define FILTER_REFS_KIND_MASK (FILTER_REFS_REGULAR | FILTER_REFS_DETACHED_HEAD | \ + FILTER_REFS_PSEUDOREFS) struct atom_value; struct ref_sorting; @@ -75,6 +78,11 @@ struct ref_filter { lines; int abbrev, verbose; + + struct { + struct contains_cache contains_cache; + struct contains_cache no_contains_cache; + } internal; }; struct ref_format { @@ -92,6 +100,11 @@ struct ref_format { /* List of bases for ahead-behind counts. */ struct string_list bases; + + struct { + int max_count; + int omit_empty; + } array_opts; }; #define REF_FILTER_INIT { \ @@ -126,6 +139,14 @@ struct ref_format { * filtered refs in the ref_array structure. */ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type); +/* + * Filter refs using the given ref_filter and type, sort the contents + * according to the given ref_sorting, format the filtered refs with the + * given ref_format, and print them to stdout. + */ +void filter_and_format_refs(struct ref_filter *filter, unsigned int type, + struct ref_sorting *sorting, + struct ref_format *format); /* Clear all memory allocated to ref_array */ void ref_array_clear(struct ref_array *array); /* Used to verify if the given format is correct and to parse out the used atoms */ @@ -151,6 +172,12 @@ char *get_head_description(void); void setup_ref_filter_porcelain_msg(void); /* + * Print up to maxcount ref_array elements to stdout using the given + * ref_format. + */ +void print_formatted_ref_array(struct ref_array *array, struct ref_format *format); + +/* * Print a single ref, outside of any ref-filter. Note that the * name must be a fully qualified refname. */ |