git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 09/16] fetch: support filters

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 19, 2018, 11:24 UTC
Message-ID
<CACsJy8D3nC+fXFYMKWh6AStbMVOVfmcAvAT9tBqtG9K6r043eQ@mail.gmail.com>
In-Reply-To
<20171208155851.855-10-git@jeffhostetler.com>
On Fri, Dec 8, 2017 at 5:00 PM Jeff Hostetler <git@jeffhostetler.com> wrote:
Show 39 quoted lines
>
> From: Jeff Hostetler <jeffhost@microsoft.com>
>
> Teach fetch to support filters. This is only allowed for the remote
> configured in extensions.partialcloneremote.
>
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
>  builtin/fetch.c       | 23 +++++++++++++++++++++--
>  connected.c           |  2 ++
>  remote-curl.c         |  6 ++++++
>  t/t5500-fetch-pack.sh | 36 ++++++++++++++++++++++++++++++++++++
>  4 files changed, 65 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index 1b1f039..14aab71 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -18,6 +18,7 @@
>  #include "argv-array.h"
>  #include "utf8.h"
>  #include "packfile.h"
> +#include "list-objects-filter-options.h"
>
>  static const char * const builtin_fetch_usage[] = {
>         N_("git fetch [<options>] [<repository> [<refspec>...]]"),
> @@ -55,6 +56,7 @@ static int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
>  static int shown_url = 0;
>  static int refmap_alloc, refmap_nr;
>  static const char **refmap_array;
> +static struct list_objects_filter_options filter_options;
>
>  static int git_fetch_config(const char *k, const char *v, void *cb)
>  {
> @@ -160,6 +162,7 @@ static struct option builtin_fetch_options[] = {
>                         TRANSPORT_FAMILY_IPV4),
>         OPT_SET_INT('6', "ipv6", &family, N_("use IPv6 addresses only"),
>                         TRANSPORT_FAMILY_IPV6),
> +       OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),

Documentation is missing. Please add something to git-fetch.txt (or fetch-options.txt) about this option. I would make a patch but I don't know enough about this to write and I'm in the middle of something else.

-- 
Duy
Previous: Jeff HostetlerNext: Jeff Hostetler
Message 4 of 24 in “Parial clone part 3: clone, fetch, fetch-pack, upload-pack, and tests”
  1. 00/16 Parial clone part 3: clone, fetch, fetch-pack, upload-pack, and testsJeff Hostetler, Dec 8, 2017
  2. 03/16 gc: do not repack promisor packfilesJeff Hostetler, Dec 8, 2017
  3. 09/16 fetch: support filtersJeff Hostetler, Dec 8, 2017
  4. Duy NguyenAug 19, 2018
  5. Jeff HostetlerAug 20, 2018
  6. 13/16 fetch-pack: restore save_commit_buffer after useJeff Hostetler, Dec 8, 2017
  7. 12/16 unpack-trees: batch fetching of missing blobsJeff Hostetler, Dec 8, 2017
  8. 11/16 clone: partial cloneJeff Hostetler, Dec 8, 2017
  9. 15/16 fetch: inherit filter-spec from partial cloneJeff Hostetler, Dec 8, 2017
  10. 16/16 t5616: test bulk prefetch after partial fetchJeff Hostetler, Dec 8, 2017
  11. 10/16 partial-clone: define partial clone settings in configJeff Hostetler, Dec 8, 2017
  12. 14/16 t5616: end-to-end tests for partial cloneJeff Hostetler, Dec 8, 2017
  13. 02/16 rev-list: support termination at promisor objectsJeff Hostetler, Dec 8, 2017
  14. 08/16 fetch: refactor calculation of remote listJeff Hostetler, Dec 8, 2017
  15. 07/16 fetch-pack: test support excluding large blobsJeff Hostetler, Dec 8, 2017
  16. 01/16 sha1_file: support lazily fetching missing objectsJeff Hostetler, Dec 8, 2017
  17. 05/16 fetch-pack, index-pack, transport: partial cloneJeff Hostetler, Dec 8, 2017
  18. 06/16 fetch-pack: add --no-filterJeff Hostetler, Dec 8, 2017
  19. 04/16 upload-pack: add object filtering for partial cloneJeff Hostetler, Dec 8, 2017
  20. Junio C HamanoDec 8, 2017
  21. Jeff HostetlerDec 8, 2017
  22. Junio C HamanoDec 8, 2017
  23. Brandon WilliamsDec 8, 2017
  24. Jonathan TanDec 11, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.