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

Re: [PATCH 4/4] upload-pack.c: introduce 'uploadpack.filter.tree.maxDepth'

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jul 15, 2020, 10:11 UTC
Message-ID
<20200715101156.GB22114@szeder.dev>
In-Reply-To
<9fa765a71d25ef3462ce81cca9754daa9b2579b6.1593720075.git.me@ttaylorr.com>
On Thu, Jul 02, 2020 at 04:06:40PM -0400, Taylor Blau wrote:
Show 15 quoted lines
> diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
> index 5dcd0b5656..8781a24cfe 100755
> --- a/t/t5616-partial-clone.sh
> +++ b/t/t5616-partial-clone.sh
> @@ -261,6 +261,14 @@ test_expect_success 'upload-pack fails banned object filters with fallback' '
>  	test_i18ngrep "filter '\''blob:none'\'' not supported" err
>  '
>  
> +test_expect_success 'upload-pack limits tree depth filters' '
> +	test_config -C srv.bare uploadpack.filter.allow false &&
> +	test_config -C srv.bare uploadpack.filter.tree.allow true &&
> +	test_config -C srv.bare uploadpack.filter.tree.maxDepth 0 &&
> +	test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \
> +		"file://$(pwd)/srv.bare" pc3
> +'

Unlike in the other three tests added earlier in this series, here you do use 'test_must_fail ok=sigpipe', but you don't check that the command died with the right error message. Saving stderr and adding

  test_i18ngrep "filter '\''tree'\'' not supported (maximum depth: 0, but got: 1)" err
makes this test flaky, too, like the other three:
  expecting success of 5616.20 'upload-pack limits tree depth filters': 
          test_config -C srv.bare uploadpack.filter.allow false &&
          test_config -C srv.bare uploadpack.filter.tree.allow true &&
          test_config -C srv.bare uploadpack.filter.tree.maxDepth 0 &&
          test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 \
                  "file://$(pwd)/srv.bare" pc3 2>err &&
          test_i18ngrep "filter 'tree' not supported (maximum depth: 0, but got: 1)" err
  
  + test_config -C srv.bare uploadpack.filter.allow false
  + test_config -C srv.bare uploadpack.filter.tree.allow true
  + test_config -C srv.bare uploadpack.filter.tree.maxDepth 0
  + pwd
  + test_must_fail ok=sigpipe git clone --no-checkout --filter=tree:1 file:///home/szeder/src/git/t/trash directory.t5616-partial-clone.stress-4/srv.bare pc3
  + test_i18ngrep filter 'tree' not supported (maximum depth: 0, but got: 1) err
  error: 'grep filter 'tree' not supported (maximum depth: 0, but got: 1) err' didn't find a match in:
  Cloning into 'pc3'...
  fatal: git upload-pack: banned object filter requested
  error: last command exited with $?=1
  not ok 20 - upload-pack limits tree depth filters
Previous: Taylor BlauNext: Jeff King
Message 20 of 25 in “upload-pack: custom allowed object filters”
  1. 0/4 upload-pack: custom allowed object filtersTaylor Blau, Jul 2, 2020
  2. 1/4 list_objects_filter_options: introduce 'list_object_filter_config_name'Taylor Blau, Jul 2, 2020
  3. 2/4 upload-pack.c: allow banning certain object filter(s)Taylor Blau, Jul 2, 2020
  4. Jeff KingJul 8, 2020
  5. Taylor BlauJul 20, 2020
  6. SZEDER GáborJul 15, 2020
  7. Jeff KingJul 15, 2020
  8. Taylor BlauJul 20, 2020
  9. Jeff KingJul 20, 2020
  10. SZEDER GáborJul 22, 2020
  11. Taylor BlauJul 22, 2020
  12. Junio C HamanoJul 23, 2020
  13. Taylor BlauJul 23, 2020
  14. SZEDER GáborJul 22, 2020
  15. Taylor BlauJul 22, 2020
  16. SZEDER GáborJul 23, 2020
  17. Taylor BlauJul 23, 2020
  18. 3/4 upload-pack.c: pass 'struct list_objects_filter_options *'Taylor Blau, Jul 2, 2020
  19. 4/4 upload-pack.c: introduce 'uploadpack.filter.tree.maxDepth'Taylor Blau, Jul 2, 2020
  20. SZEDER GáborJul 15, 2020
  21. Jeff KingJul 8, 2020
  22. Taylor BlauJul 20, 2020
  23. Junio C HamanoJul 21, 2020
  24. Taylor BlauJul 21, 2020
  25. Junio C HamanoJul 21, 2020

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.