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

Re: [PATCH v2] upload-pack.c: fix filter spec quoting bug

From
Jeff King <peff@peff.net>
Date
Jan 25, 2021, 21:16 UTC
Message-ID
<YA81EwddIG7QVI/1@coredump.intra.peff.net>
In-Reply-To
<20210125170921.14291-1-jacob@gitlab.com>
On Mon, Jan 25, 2021 at 06:09:21PM +0100, Jacob Vosmaer wrote:
> +test_expect_success 'hook works with partial clone' '
> +	clear_hook_results &&
> +	test_config_global uploadpack.packObjectsHook ./hook &&
> +	test_config_global uploadpack.allowFilter true &&
I was going to complain that:
 test_config -C dst.git uploadpack.packObjectsHook ./hook &&
 test_config -C dst.git uploadpack.allowFilter true &&

would be more clear, since it tells us which repo we care about impacting. But the rest of the script doesn't do that, and indeed it can't, because we don't allow packObjectsHook to be set in per-repo config for security reasons. :)

(We could do it per-repo for allowFilter, but I think it is just as well to keep the two calls consistent).

> +	git clone --bare --no-local --filter=blob:none . dst.git &&
> +	git -C dst.git rev-list --objects --missing=print HEAD >objects &&
> +	grep "^?" objects

Previously that clone would fail, so the bug-fix is demonstrated by it succeeding. But the other two commands are added to make sure that we actually did apply the filter correctly. Even better. Thanks for being thorough.

-Peff
Previous: Junio C HamanoNext: Jacob Vosmaer
Message 11 of 13 in “upload-pack.c: fix filter spec quoting bug”
  1. 0/1 upload-pack.c: fix filter spec quoting bugJacob Vosmaer, Jan 22, 2021
  2. 1/1 upload-pack.c: fix filter spec quoting bugJacob Vosmaer, Jan 22, 2021
  3. Jeff KingJan 22, 2021
  4. run-command: document use_shell optionJeff King, Jan 22, 2021
  5. Taylor BlauJan 22, 2021
  6. Junio C HamanoJan 22, 2021
  7. Jeff KingJan 23, 2021
  8. Junio C HamanoJan 22, 2021
  9. upload-pack.c: fix filter spec quoting bugJacob Vosmaer, Jan 25, 2021
  10. Junio C HamanoJan 25, 2021
  11. Jeff KingJan 25, 2021
  12. Jacob VosmaerJan 25, 2021
  13. Jacob VosmaerJan 25, 2021

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.