summaryrefslogtreecommitdiff
path: root/list-objects-filter-options.h
diff options
context:
space:
mode:
authorMatthew DeVore <matvore@google.com>2019-06-27 22:54:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-28 15:41:53 (GMT)
commite987df5fe62b8b29be4cdcdeb3704681ada2b29e (patch)
tree682c4340314a908de1baaf9bb31d894e077193d7 /list-objects-filter-options.h
parent842b00516aebee06fc99c51a663b6587f642d36d (diff)
downloadgit-e987df5fe62b8b29be4cdcdeb3704681ada2b29e.zip
git-e987df5fe62b8b29be4cdcdeb3704681ada2b29e.tar.gz
git-e987df5fe62b8b29be4cdcdeb3704681ada2b29e.tar.bz2
list-objects-filter: implement composite filters
Allow combining filters such that only objects accepted by all filters are shown. The motivation for this is to allow getting directory listings without also fetching blobs. This can be done by combining blob:none with tree:<depth>. There are massive repositories that have larger-than-expected trees - even if you include only a single commit. A combined filter supports any number of subfilters, and is written in the following form: combine:<filter 1>+<filter 2>+<filter 3> Certain non-alphanumeric characters in each filter must be URL-encoded. For now, combined filters must be specified in this form. In a subsequent commit, rev-list will support multiple --filter arguments which will have the same effect as specifying one filter argument starting with "combine:". The documentation will be updated in that commit, as the URL-encoding scheme is in general not meant to be used directly by the user, and it is better to describe the URL-encoding feature in terms of the repeated flag. Helped-by: Emily Shaffer <emilyshaffer@google.com> Helped-by: Jeff Hostetler <git@jeffhostetler.com> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Helped-by: Jonathan Tan <jonathantanmy@google.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Matthew DeVore <matvore@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects-filter-options.h')
-rw-r--r--list-objects-filter-options.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/list-objects-filter-options.h b/list-objects-filter-options.h
index c54f000..789faef 100644
--- a/list-objects-filter-options.h
+++ b/list-objects-filter-options.h
@@ -13,6 +13,7 @@ enum list_objects_filter_choice {
LOFC_BLOB_LIMIT,
LOFC_TREE_DEPTH,
LOFC_SPARSE_OID,
+ LOFC_COMBINE,
LOFC__COUNT /* must be last */
};
@@ -38,13 +39,23 @@ struct list_objects_filter_options {
unsigned int no_filter : 1;
/*
- * Parsed values (fields) from within the filter-spec. These are
- * choice-specific; not all values will be defined for any given
- * choice.
+ * BEGIN choice-specific parsed values from within the filter-spec. Only
+ * some values will be defined for any given choice.
*/
+
struct object_id *sparse_oid_value;
unsigned long blob_limit_value;
unsigned long tree_exclude_depth;
+
+ /* LOFC_COMBINE values */
+
+ /* This array contains all the subfilters which this filter combines. */
+ size_t sub_nr, sub_alloc;
+ struct list_objects_filter_options *sub;
+
+ /*
+ * END choice-specific parsed values.
+ */
};
/* Normalized command line arguments */