<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t5317-pack-objects-filter-objects.sh, branch v2.26.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-11-29T21:20:15Z</updated>
<entry>
<title>t5317: use ! grep to check for no matching lines</title>
<updated>2019-11-29T21:20:15Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-11-27T19:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a29b2429e583794c27d9527e105b1ce7500e8062'/>
<id>urn:sha1:a29b2429e583794c27d9527e105b1ce7500e8062</id>
<content type='text'>
Several times in t5317, we would use `wc -l` to ensure that a grep
result is empty. However, grep already has a way to do that... Its
return code! Use `! grep` in the cases where we are ensuring that there
are no matching lines.

While at it, drop unnecessary invocations of `awk` and `sort` in each
affected test since those commands do not influence the outcome. It's
not clear why that extra work was being done in the first place, and the
code's history doesn't shed any light on the matter since these tests
were simply born this way[1], likely due to copy-paste programming. The
unnecessary work wasn't noticed even when the code was later touched for
various cleanups[2][3].

[1]: 9535ce7337 (pack-objects: add list-objects filtering, 2017-11-21)
[2]: bdbc17e86a (tests: standardize pipe placement, 2018-10-05)
[3]: 61de0ff695 (tests: don't swallow Git errors upstream of pipes, 2018-10-05)

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t5317: stop losing return codes of git commands</title>
<updated>2019-11-29T21:20:14Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-11-27T19:53:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c37f3ec1b89f317bd379ce4db307f700ca4acd9'/>
<id>urn:sha1:6c37f3ec1b89f317bd379ce4db307f700ca4acd9</id>
<content type='text'>
Currently, there are two ways where the return codes of git commands are
lost. The first way is when a command is in the upstream of a pipe. In a
pipe, only the return code of the last command is used. Thus, all other
commands will have their return codes masked. Rewrite pipes so that
there are no git commands upstream.

The other way is when a command is in a non-assignment command
substitution. The return code will be lost in favour of the surrounding
command's. Rewrite instances of this such that git commands output to a
file and surrounding commands only call command substitutions with
non-git commands.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>list-objects-filter: disable 'sparse:path' filters</title>
<updated>2019-05-29T18:05:34Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2019-05-29T12:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e693237e2ba27b6129e8af7f6a794f5c2fbd26f3'/>
<id>urn:sha1:e693237e2ba27b6129e8af7f6a794f5c2fbd26f3</id>
<content type='text'>
If someone wants to use as a filter a sparse file that is in the
repository, something like "--filter=sparse:oid=&lt;ref&gt;:&lt;path&gt;"
already works.

So 'sparse:path' is only interesting if the sparse file is not in
the repository. In this case though the current implementation has
a big security issue, as it makes it possible to ask the server to
read any file, like for example /etc/password, and to explore the
filesystem, as well as individual lines of files.

If someone is interested in using a sparse file that is not in the
repository as a filter, then at the minimum a config option, such
as "uploadpack.sparsePathFilter", should be implemented first to
restrict the directory from which the files specified by
'sparse:path' can be read.

For now though, let's just disable 'sparse:path' filters.

Helped-by: Matthew DeVore &lt;matvore@google.com&gt;
Helped-by: Jeff Hostetler &lt;git@jeffhostetler.com&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests (pack-objects): use the full, unabbreviated `--revs` option</title>
<updated>2019-04-02T00:55:00Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2019-03-25T18:14:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=effc2bae642a08ea0cb4a9020cb57632d00ab1a0'/>
<id>urn:sha1:effc2bae642a08ea0cb4a9020cb57632d00ab1a0</id>
<content type='text'>
To use the singular form of a word, when the option wants the plural
form (and quietly expands it because it thinks it was abbreviated), is
an easy mistake to make, and t5317 contains almost two dozen of them.

However, using abbreviated options in tests is a bit fragile, so we will
disallow use of abbreviated options in our test suite.

In preparation for this change, let's fix
`t5317-pack-objects-filter-objects.sh`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'md/filter-trees'</title>
<updated>2018-10-30T06:43:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77d503757d6328703f9571a4432dd83800bc26bb'/>
<id>urn:sha1:77d503757d6328703f9571a4432dd83800bc26bb</id>
<content type='text'>
The "rev-list --filter" feature learned to exclude all trees via
"tree:0" filter.

* md/filter-trees:
  list-objects: support for skipping tree traversal
  filter-trees: code clean-up of tests
  list-objects-filter: implement filter tree:0
  list-objects-filter-options: do not over-strbuf_init
  list-objects-filter: use BUG rather than die
  revision: mark non-user-given objects instead
  rev-list: handle missing tree objects properly
  list-objects: always parse trees gently
  list-objects: refactor to process_tree_contents
  list-objects: store common func args in struct
</content>
</entry>
<entry>
<title>filter-trees: code clean-up of tests</title>
<updated>2018-10-15T03:43:17Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-12T20:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9e6d0942bb9f9fe9e4cca9670181e5b59074bcb'/>
<id>urn:sha1:d9e6d0942bb9f9fe9e4cca9670181e5b59074bcb</id>
<content type='text'>
A few trivial updates to test to match the current best practices.

 - avoid "grep -q" that strips potentially useful output from tests
   running under "-v".

 - use test_write_lines to prepare multi-line expected output file.

 - reserve use of test_must_fail to "git" commands.

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>list-objects-filter: implement filter tree:0</title>
<updated>2018-10-06T23:55:00Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-05T21:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc5975d24f33c974d53b3d94c5697fadaec5b000'/>
<id>urn:sha1:bc5975d24f33c974d53b3d94c5697fadaec5b000</id>
<content type='text'>
Teach list-objects the "tree:0" filter which allows for filtering
out all tree and blob objects (unless other objects are explicitly
specified by the user). The purpose of this patch is to allow smaller
partial clones.

The name of this filter - tree:0 - does not explicitly specify that
it also filters out all blobs, but this should not cause much confusion
because blobs are not at all useful without the trees that refer to
them.

I also considered only:commits as a name, but this is inaccurate because
it suggests that annotated tags are omitted, but actually they are
included.

The name "tree:0" allows later filtering based on depth, i.e. "tree:1"
would filter out all but the root tree and blobs. In order to avoid
confusion between 0 and capital O, the documentation was worded in a
somewhat round-about way that also hints at this future improvement to
the feature.

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-list: handle missing tree objects properly</title>
<updated>2018-10-06T23:55:00Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-05T21:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c0fe330d5f3d2fc7aac57a19c7580ea2543c799'/>
<id>urn:sha1:7c0fe330d5f3d2fc7aac57a19c7580ea2543c799</id>
<content type='text'>
Previously, we assumed only blob objects could be missing. This patch
makes rev-list handle missing trees like missing blobs. The --missing=*
and --exclude-promisor-objects flags now work for trees as they already
do for blobs. This is demonstrated in t6112.

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: don't swallow Git errors upstream of pipes</title>
<updated>2018-10-06T23:51:18Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-05T21:54:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f'/>
<id>urn:sha1:61de0ff695cf632f1a17fc0ebd4401bde2f7fa8f</id>
<content type='text'>
Some pipes in tests lose the exit code of git processes, which can mask
unexpected behavior like crashes. Split these pipes up so that git
commands are only at the end of pipes rather than the beginning or
middle.

The violations fixed in this patch were found in the process of fixing
pipe placement in a prior patch.

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/*: fix ordering of expected/observed arguments</title>
<updated>2018-10-06T23:51:18Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-05T21:54:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dcbaa0b361f5bebcbe6eca446819fadd02083461'/>
<id>urn:sha1:dcbaa0b361f5bebcbe6eca446819fadd02083461</id>
<content type='text'>
Fix various places where the ordering was obviously wrong, meaning it
was easy to find with grep.

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