<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/list-objects-filter-options.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-16T22:28:25Z</updated>
<entry>
<title>list-objects-filter-options: fix function name in BUG</title>
<updated>2020-11-16T22:28:25Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-11-14T08:43:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a923bb1f0f1ba01f8845dd7dc78bb354e8c79bc'/>
<id>urn:sha1:5a923bb1f0f1ba01f8845dd7dc78bb354e8c79bc</id>
<content type='text'>
Fix the function name we give in the BUG message. It's "config", not
"choice".

Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch: do not override partial clone filter</title>
<updated>2020-09-28T23:11:59Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-09-28T22:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23547c40518ac04a20acf2f688114f5d97b61f24'/>
<id>urn:sha1:23547c40518ac04a20acf2f688114f5d97b61f24</id>
<content type='text'>
When a fetch with the --filter argument is made, the configured default
filter is set even if one already exists. This change was made in
5e46139376 ("builtin/fetch: remove unique promisor remote limitation",
2019-06-25) - in particular, changing from:

 * If this is the FIRST partial-fetch request, we enable partial
 * on this repo and remember the given filter-spec as the default
 * for subsequent fetches to this remote.

to:

 * If this is a partial-fetch request, we enable partial on
 * this repo if not already enabled and remember the given
 * filter-spec as the default for subsequent fetches to this
 * remote.

(The given filter-spec is "remembered" even if there is already an
existing one.)

This is problematic whenever a lazy fetch is made, because lazy fetches
are made using "git fetch --filter=blob:none", but this will also happen
if the user invokes "git fetch --filter=&lt;filter&gt;" manually. Therefore,
restore the behavior prior to 5e46139376, which writes a filter-spec
only if the current fetch request is the first partial-fetch one (for
that remote).

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/upload-pack-filters'</title>
<updated>2020-08-12T01:04:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-12T01:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73a925516604df7a95ad69b8d650275eb4ab270f'/>
<id>urn:sha1:73a925516604df7a95ad69b8d650275eb4ab270f</id>
<content type='text'>
The component to respond to "git fetch" request is made more
configurable to selectively allow or reject object filtering
specification used for partial cloning.

* tb/upload-pack-filters:
  t5616: use test_i18ngrep for upload-pack errors
  upload-pack.c: introduce 'uploadpackfilter.tree.maxDepth'
  upload-pack.c: allow banning certain object filter(s)
  list_objects_filter_options: introduce 'list_object_filter_config_name'
</content>
</entry>
<entry>
<title>list_objects_filter_options: introduce 'list_object_filter_config_name'</title>
<updated>2020-08-04T01:03:24Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-07-31T20:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9ea214795b89e0455bbe92fab5d30d1f3a4cc6d'/>
<id>urn:sha1:b9ea214795b89e0455bbe92fab5d30d1f3a4cc6d</id>
<content type='text'>
In a subsequent commit, we will add configuration options that are
specific to each kind of object filter, in which case it is handy to
have a function that translates between 'enum
list_objects_filter_choice' and an appropriate configuration-friendly
string.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strvec: rename files from argv-array to strvec</title>
<updated>2020-07-28T22:02:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98'/>
<id>urn:sha1:dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98</id>
<content type='text'>
This requires updating #include lines across the code-base, but that's
all fairly mechanical, and was done with:

  git ls-files '*.c' '*.h' |
  xargs perl -i -pe 's/argv-array.h/strvec.h/'

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repository: add a helper function to perform repository format upgrade</title>
<updated>2020-06-05T17:13:30Z</updated>
<author>
<name>Xin Li</name>
<email>delphij@google.com</email>
</author>
<published>2020-06-05T09:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16af5f1abb2b3291f96a248698449c48c6a0ec36'/>
<id>urn:sha1:16af5f1abb2b3291f96a248698449c48c6a0ec36</id>
<content type='text'>
In version 1 of repository format, "extensions" gained special meaning
and it is safer to avoid upgrading when there are pre-existing
extensions.

Make list-objects-filter to use the helper function instead of setting
repository version directly as a prerequisite of exposing the upgrade
capability.

Signed-off-by: Xin Li &lt;delphij@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/partial-clone-sparse-blob'</title>
<updated>2019-10-07T02:32:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-10-07T02:32:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad8f0368b45bf1ab0f1339033d0a62cee94b1ae2'/>
<id>urn:sha1:ad8f0368b45bf1ab0f1339033d0a62cee94b1ae2</id>
<content type='text'>
The name of the blob object that stores the filter specification
for sparse cloning/fetching was interpreted in a wrong place in the
code, causing Git to abort.

* jk/partial-clone-sparse-blob:
  list-objects-filter: use empty string instead of NULL for sparse "base"
  list-objects-filter: give a more specific error sparse parsing error
  list-objects-filter: delay parsing of sparse oid
  t5616: test cloning/fetching with sparse:oid=&lt;oid&gt; filter
</content>
</entry>
<entry>
<title>Merge branch 'md/list-objects-filter-combo'</title>
<updated>2019-09-18T18:50:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-09-18T18:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=627b82683447e299fc2e20140318c276efbf7de2'/>
<id>urn:sha1:627b82683447e299fc2e20140318c276efbf7de2</id>
<content type='text'>
The list-objects-filter API (used to create a sparse/lazy clone)
learned to take a combined filter specification.

* md/list-objects-filter-combo:
  list-objects-filter-options: make parser void
  list-objects-filter-options: clean up use of ALLOC_GROW
  list-objects-filter-options: allow mult. --filter
  strbuf: give URL-encoding API a char predicate fn
  list-objects-filter-options: make filter_spec a string_list
  list-objects-filter-options: move error check up
  list-objects-filter: implement composite filters
  list-objects-filter-options: always supply *errbuf
  list-objects-filter: put omits set in filter struct
  list-objects-filter: encapsulate filter components
</content>
</entry>
<entry>
<title>list-objects-filter: delay parsing of sparse oid</title>
<updated>2019-09-16T19:47:37Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-09-15T16:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c96a775945d0299e39b982ab9cb32c5132e877d'/>
<id>urn:sha1:4c96a775945d0299e39b982ab9cb32c5132e877d</id>
<content type='text'>
The list-objects-filter code has two steps to its initialization:

  1. parse_list_objects_filter() makes sure the spec is a filter we know
     about and is syntactically correct. This step is done by "rev-list"
     or "upload-pack" that is going to apply a filter, but also by "git
     clone" or "git fetch" before they send the spec across the wire.

  2. list_objects_filter__init() runs the type-specific initialization
     (using function pointers established in step 1). This happens at
     the start of traverse_commit_list_filtered(), when we're about to
     actually use the filter.

It's a good idea to parse as much as we can in step 1, in order to catch
problems early (e.g., a blob size limit that isn't a number). But one
thing we _shouldn't_ do is resolve any oids at that step (e.g., for
sparse-file contents specified by oid). In the case of a fetch, the oid
has to be resolved on the remote side.

The current code does resolve the oid during the parse phase, but
ignores any error (which we must do, because we might just be sending
the spec across the wire). This leads to two bugs:

  - if we're not in a repository (e.g., because it's git-clone parsing
    the spec), then we trigger a BUG() trying to resolve the name

  - if we did hit the error case, we still have to notice that later and
    bail. The code path in rev-list handles this, but the one in
    upload-pack does not, leading to a segfault.

We can fix both by moving the oid resolution into the sparse-oid init
function. At that point we know we have a repository (because we're
about to traverse), and handling the error there fixes the segfault.

As a bonus, we can drop the NULL sparse_oid_value check in rev-list,
since this is now handled in the sparse-oid-filter init function.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>list-objects-filter-options: make parser void</title>
<updated>2019-06-28T15:41:53Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2019-06-27T22:54:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90d21f9ebf6906f0ebb4fb1b20ec9536072e2916'/>
<id>urn:sha1:90d21f9ebf6906f0ebb4fb1b20ec9536072e2916</id>
<content type='text'>
This function always returns 0, so make it return void instead.

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
