{"thread":{"id":"47379","subject":"[PATCH v6 0/3] Partial clone part 1: object filtering","startedAt":"2017-12-05T16:54:40Z","lastAt":"2017-12-13T18:38:34Z","messageCount":6,"participants":["Jeff Hostetler","Christian Couder"],"isPatch":true,"patchVersion":6,"patchTotal":3},"messages":[{"id":"334165","messageId":"20171205165014.64488-1-git@jeffhostetler.com","threadId":"47379","inReplyTo":null,"subject":"[PATCH v6 0/3] Partial clone part 1: object filtering","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-12-05T16:50:11Z","receivedAt":"2017-12-05T16:54:40Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Jeff Hostetler <jeffhost@microsoft.com>\n\nHere is V6 of the list-object filtering, rev-list, and pack-objects.\n\nThis is an incremental patch series to be applied on top of V5\nwhich is already in 'next'.\n\nThis version fixes a typo, add the --no-filter option, eliminates\na couple of asserts(), and updates the documentation.\n\nChristian Couder (1):\n  list-objects-filter-options: fix 'keword' typo in comment\n\nJeff Hostetler (2):\n  list-objects-filter-options: support --no-filter\n  rev-list: support --no-filter argument\n\n Documentation/git-pack-objects.txt |  3 +++\n Documentation/rev-list-options.txt | 15 ++++++++++-----\n builtin/rev-list.c                 |  4 ++++\n list-objects-filter-options.c      | 17 ++++++++++++++---\n list-objects-filter-options.h      |  5 ++++-\n 5 files changed, 35 insertions(+), 9 deletions(-)\n\n-- \n2.9.3\n\n"},{"id":"334166","messageId":"20171205165014.64488-3-git@jeffhostetler.com","threadId":"47379","inReplyTo":"20171205165014.64488-1-git@jeffhostetler.com","subject":"[PATCH v6 2/3] list-objects-filter-options: support --no-filter","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-12-05T16:50:13Z","receivedAt":"2017-12-05T16:54:48Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Jeff Hostetler <jeffhost@microsoft.com>\n\nTeach opt_parse_list_objects_filter() to take --no-filter\noption and to free the contents of struct filter_options.\nThis command line argument will be automatically inherited\nby commands using OPT_PARSE_LIST_OBJECTS_FILTER(); this\nincludes pack-objects.\n\nSigned-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n---\n Documentation/git-pack-objects.txt |  3 +++\n list-objects-filter-options.c      | 15 +++++++++++++--\n list-objects-filter-options.h      |  5 ++++-\n 3 files changed, 20 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex b924c6c..aa403d0 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -242,6 +242,9 @@ So does `git bundle` (see linkgit:git-bundle[1]) when it creates a bundle.\n \tthe resulting packfile.  See linkgit:git-rev-list[1] for valid\n \t`<filter-spec>` forms.\n \n+--no-filter::\n+\tTurns off any previous `--filter=` argument.\n+\n --missing=<missing-action>::\n \tA debug option to help with future \"partial clone\" development.\n \tThis option specifies how missing objects are handled.\ndiff --git a/list-objects-filter-options.c b/list-objects-filter-options.c\nindex 52bdec7..4c5b34e 100644\n--- a/list-objects-filter-options.c\n+++ b/list-objects-filter-options.c\n@@ -74,8 +74,19 @@ int opt_parse_list_objects_filter(const struct option *opt,\n {\n \tstruct list_objects_filter_options *filter_options = opt->value;\n \n-\tassert(arg);\n-\tassert(!unset);\n+\tif (unset || !arg) {\n+\t\tlist_objects_filter_release(filter_options);\n+\t\treturn 0;\n+\t}\n \n \treturn parse_list_objects_filter(filter_options, arg);\n }\n+\n+void list_objects_filter_release(\n+\tstruct list_objects_filter_options *filter_options)\n+{\n+\tfree(filter_options->filter_spec);\n+\tfree(filter_options->sparse_oid_value);\n+\tfree(filter_options->sparse_path_value);\n+\tmemset(filter_options, 0, sizeof(*filter_options));\n+}\ndiff --git a/list-objects-filter-options.h b/list-objects-filter-options.h\nindex dd7e5db..eea44a1 100644\n--- a/list-objects-filter-options.h\n+++ b/list-objects-filter-options.h\n@@ -52,7 +52,10 @@ int opt_parse_list_objects_filter(const struct option *opt,\n \n #define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \\\n \t{ OPTION_CALLBACK, 0, CL_ARG__FILTER, fo, N_(\"args\"), \\\n-\t  N_(\"object filtering\"), PARSE_OPT_NONEG, \\\n+\t  N_(\"object filtering\"), 0, \\\n \t  opt_parse_list_objects_filter }\n \n+void list_objects_filter_release(\n+\tstruct list_objects_filter_options *filter_options);\n+\n #endif /* LIST_OBJECTS_FILTER_OPTIONS_H */\n-- \n2.9.3\n\n"},{"id":"334167","messageId":"20171205165014.64488-4-git@jeffhostetler.com","threadId":"47379","inReplyTo":"20171205165014.64488-1-git@jeffhostetler.com","subject":"[PATCH v6 3/3] rev-list: support --no-filter argument","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-12-05T16:50:14Z","receivedAt":"2017-12-05T16:54:50Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Jeff Hostetler <jeffhost@microsoft.com>\n\nTeach rev-list to support --no-filter to override a\nprevious --filter=<filter_spec> argument.  This is\nto be consistent with commands that use OPT_PARSE\nmacros.\n\nSigned-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n---\n Documentation/rev-list-options.txt | 15 ++++++++++-----\n builtin/rev-list.c                 |  4 ++++\n 2 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 11bb87f..8d8b7f4 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -715,16 +715,21 @@ ifdef::git-rev-list[]\n The form '--filter=blob:none' omits all blobs.\n +\n The form '--filter=blob:limit=<n>[kmg]' omits blobs larger than n bytes\n-or units.  The value may be zero.\n+or units.  n may be zero.  The suffixes k, m, and g can be used to name\n+units in KiB, MiB, or GiB.  For example, 'blob:limit=1k' is the same\n+as 'blob:limit=1024'.\n +\n-The form '--filter=sparse:oid=<oid-ish>' uses a sparse-checkout\n-specification contained in the object (or the object that the expression\n-evaluates to) to omit blobs that would not be not required for a\n-sparse checkout on the requested refs.\n+The form '--filter=sparse:oid=<blob-ish>' uses a sparse-checkout\n+specification contained in the blob (or blob-expression) '<blob-ish>'\n+to omit blobs that would not be not required for a sparse checkout on\n+the requested refs.\n +\n The form '--filter=sparse:path=<path>' similarly uses a sparse-checkout\n specification contained in <path>.\n \n+--no-filter::\n+\tTurn off any previous `--filter=` argument.\n+\n --filter-print-omitted::\n \tOnly useful with `--filter=`; prints a list of the objects omitted\n \tby the filter.\tObject IDs are prefixed with a ``~'' character.\ndiff --git a/builtin/rev-list.c b/builtin/rev-list.c\nindex 4700473..547a3e0 100644\n--- a/builtin/rev-list.c\n+++ b/builtin/rev-list.c\n@@ -403,6 +403,10 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)\n \t\t\t\t    filter_options.filter_spec);\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(arg, (\"--no-\" CL_ARG__FILTER))) {\n+\t\t\tlist_objects_filter_release(&filter_options);\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(arg, \"--filter-print-omitted\")) {\n \t\t\targ_print_omitted = 1;\n \t\t\tcontinue;\n-- \n2.9.3\n\n"},{"id":"334168","messageId":"20171205165014.64488-2-git@jeffhostetler.com","threadId":"47379","inReplyTo":"20171205165014.64488-1-git@jeffhostetler.com","subject":"[PATCH v6 1/3] list-objects-filter-options: fix 'keword' typo in comment","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-12-05T16:50:12Z","receivedAt":"2017-12-05T16:54:51Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"From: Christian Couder <christian.couder@gmail.com>\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\nSigned-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n---\n list-objects-filter-options.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/list-objects-filter-options.c b/list-objects-filter-options.c\nindex 9b28322..52bdec7 100644\n--- a/list-objects-filter-options.c\n+++ b/list-objects-filter-options.c\n@@ -8,7 +8,7 @@\n #include \"list-objects-filter-options.h\"\n \n /*\n- * Parse value of the argument to the \"filter\" keword.\n+ * Parse value of the argument to the \"filter\" keyword.\n  * On the command line this looks like:\n  *       --filter=<arg>\n  * and in the pack protocol as:\n-- \n2.9.3\n\n"},{"id":"334590","messageId":"CAP8UFD1A8+tRqeY5v9gbbUHY6W6fS2LS-7Z3zCqiBZQ8ZTHkNg@mail.gmail.com","threadId":"47379","inReplyTo":"20171205165014.64488-4-git@jeffhostetler.com","subject":"Re: [PATCH v6 3/3] rev-list: support --no-filter argument","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2017-12-11T06:17:38Z","receivedAt":"2017-12-11T06:20:19Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Dec 5, 2017 at 5:50 PM, Jeff Hostetler <git@jeffhostetler.com> wrote:\n> From: Jeff Hostetler <jeffhost@microsoft.com>\n>\n> Teach rev-list to support --no-filter to override a\n> previous --filter=<filter_spec> argument.  This is\n> to be consistent with commands that use OPT_PARSE\n> macros.\n>\n> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n> ---\n>  Documentation/rev-list-options.txt | 15 ++++++++++-----\n>  builtin/rev-list.c                 |  4 ++++\n>  2 files changed, 14 insertions(+), 5 deletions(-)\n>\n> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n> index 11bb87f..8d8b7f4 100644\n> --- a/Documentation/rev-list-options.txt\n> +++ b/Documentation/rev-list-options.txt\n> @@ -715,16 +715,21 @@ ifdef::git-rev-list[]\n>  The form '--filter=blob:none' omits all blobs.\n>  +\n>  The form '--filter=blob:limit=<n>[kmg]' omits blobs larger than n bytes\n> -or units.  The value may be zero.\n> +or units.  n may be zero.  The suffixes k, m, and g can be used to name\n\n\"'<n>' may be zero\" would be more consistent with other parts of this file.\ns/k, m, and g/'k', 'm', and 'g'/ could also help.\n\n> +units in KiB, MiB, or GiB.  For example, 'blob:limit=1k' is the same\n> +as 'blob:limit=1024'.\n>  +\n> -The form '--filter=sparse:oid=<oid-ish>' uses a sparse-checkout\n> -specification contained in the object (or the object that the expression\n> -evaluates to) to omit blobs that would not be not required for a\n> -sparse checkout on the requested refs.\n> +The form '--filter=sparse:oid=<blob-ish>' uses a sparse-checkout\n> +specification contained in the blob (or blob-expression) '<blob-ish>'\n\nFor example here '<blob-ish>' is used.\n\n> +to omit blobs that would not be not required for a sparse checkout on\n> +the requested refs.\n"},{"id":"334771","messageId":"ac918329-82bb-1d71-ae44-df16878b4934@jeffhostetler.com","threadId":"47379","inReplyTo":"CAP8UFD1A8+tRqeY5v9gbbUHY6W6fS2LS-7Z3zCqiBZQ8ZTHkNg@mail.gmail.com","subject":"Re: [PATCH v6 3/3] rev-list: support --no-filter argument","fromName":"Jeff Hostetler","fromEmail":"git@jeffhostetler.com","sentAt":"2017-12-13T18:38:26Z","receivedAt":"2017-12-13T18:38:34Z","isPatch":true,"sender":{"key":"git@jeffhostetler.com","avatar":null},"body":"\n\nOn 12/11/2017 1:17 AM, Christian Couder wrote:\n> On Tue, Dec 5, 2017 at 5:50 PM, Jeff Hostetler <git@jeffhostetler.com> wrote:\n>> From: Jeff Hostetler <jeffhost@microsoft.com>\n>>\n>> Teach rev-list to support --no-filter to override a\n>> previous --filter=<filter_spec> argument.  This is\n>> to be consistent with commands that use OPT_PARSE\n>> macros.\n>>\n>> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>\n>> ---\n>>   Documentation/rev-list-options.txt | 15 ++++++++++-----\n>>   builtin/rev-list.c                 |  4 ++++\n>>   2 files changed, 14 insertions(+), 5 deletions(-)\n>>\n>> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n>> index 11bb87f..8d8b7f4 100644\n>> --- a/Documentation/rev-list-options.txt\n>> +++ b/Documentation/rev-list-options.txt\n>> @@ -715,16 +715,21 @@ ifdef::git-rev-list[]\n>>   The form '--filter=blob:none' omits all blobs.\n>>   +\n>>   The form '--filter=blob:limit=<n>[kmg]' omits blobs larger than n bytes\n>> -or units.  The value may be zero.\n>> +or units.  n may be zero.  The suffixes k, m, and g can be used to name\n> \n> \"'<n>' may be zero\" would be more consistent with other parts of this file.\n> s/k, m, and g/'k', 'm', and 'g'/ could also help.\n\ngood catch. thanks.\njeff\n\n"}]}