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

Re: [PATCH v2 2/2] Mark 'git cat-file' sparse-index compatible

From
Derrick Stolee <stolee@gmail.com>
Date
Sep 3, 2024, 14:17 UTC
Message-ID
<83ec9352-d274-4d05-a6b8-d33924f46205@gmail.com>
In-Reply-To
<a92825e502f1795910b869165779279b89212939.1725052243.git.gitgitgadget@gmail.com>
On 8/30/24 5:10 PM, Kevin Lyles via GitGitGadget wrote:
> From: Kevin Lyles <klyles+github@epic.com>
Show 11 quoted lines
> +test_expect_success 'cat-file -p' '
> +	init_repos &&
> +	echo "new content" >>full-checkout/deep/a &&
> +	echo "new content" >>sparse-checkout/deep/a &&
> +	echo "new content" >>sparse-index/deep/a &&
> +	run_on_all git add deep/a &&
> +
> +	test_all_match git cat-file -p :deep/a &&
> +	ensure_not_expanded cat-file -p :deep/a &&
> +	test_all_match git cat-file -p :folder1/a &&
> +	ensure_expanded cat-file -p :folder1/a'

There's one style issue that I missed in the previous version, which is that the final single-quote (') should be on a new line after the last line of the test. like this:

---
	test_all_match git cat-file -p :folder1/a &&
	ensure_expanded cat-file -p :folder1/a
'
---
Show 16 quoted lines
> +test_expect_success 'cat-file --batch' '
> +	init_repos &&
> +	echo "new content" >>full-checkout/deep/a &&
> +	echo "new content" >>sparse-checkout/deep/a &&
> +	echo "new content" >>sparse-index/deep/a &&
> +	run_on_all git add deep/a &&
> +
> +	echo ":deep/a">in &&
> +	test_all_match git cat-file --batch <in &&
> +	ensure_not_expanded cat-file --batch <in &&
> +
> +	echo ":folder1/a">in &&
> +	test_all_match git cat-file --batch <in &&
> +	ensure_expanded cat-file --batch <in &&
> +
> +	cat <<-\EOF >in &&
nit: typically we would write this as "cat >in <<-\EOF &&"
Show 6 quoted lines
> +	:deep/a
> +	:folder1/a
> +	EOF
> +	test_all_match git cat-file --batch <in &&
> +	ensure_expanded cat-file --batch <in'
> +
Pointing out the final single-quote here, too.

Thank you for updating the heredocs and other format things that I noticed in the previous version. Also, thanks for splitting the patch into two parts.

Thanks for working on this! -Stolee

Previous: Kevin Lyles via GitGitGadgetNext: Junio C Hamano
Message 6 of 17 in “Mark `cat-file` sparse-index compatible”
  1. Mark `cat-file` sparse-index compatibleKevin Lyles via GitGitGadget, Aug 26, 2024
  2. Derrick StoleeAug 29, 2024
  3. 0/2 Mark cat-file sparse-index compatibleKevin Lyles via GitGitGadget, Aug 30, 2024
  4. 1/2 Allow using stdin in run_on_* functionsKevin Lyles via GitGitGadget, Aug 30, 2024
  5. 2/2 Mark 'git cat-file' sparse-index compatibleKevin Lyles via GitGitGadget, Aug 30, 2024
  6. Derrick StoleeSep 3, 2024
  7. Junio C HamanoSep 3, 2024
  8. 0/2 Mark 'git cat-file' sparse-index compatibleKevin Lyles via GitGitGadget, Sep 3, 2024
  9. 1/2 Allow using stdin in run_on_* functionsKevin Lyles via GitGitGadget, Sep 3, 2024
  10. Junio C HamanoSep 3, 2024
  11. 2/2 Mark 'git cat-file' sparse-index compatibleKevin Lyles via GitGitGadget, Sep 3, 2024
  12. Junio C HamanoSep 3, 2024
  13. 0/2 builtin/cat-file: mark 'git cat-file' sparse-index compatibleKevin Lyles via GitGitGadget, Sep 3, 2024
  14. 1/2 t1092: allow run_on_* functions to use standard inputKevin Lyles via GitGitGadget, Sep 3, 2024
  15. Junio C HamanoSep 4, 2024
  16. 2/2 builtin/cat-file: mark 'git cat-file' sparse-index compatibleKevin Lyles via GitGitGadget, Sep 3, 2024
  17. Junio C HamanoSep 4, 2024

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.