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

Re: [PATCH 2/4] t5329: test 'git gc --cruft' without '--prune=now'

From
Derrick Stolee <derrickstolee@github.com>
Date
Jun 15, 2022, 13:28 UTC
Message-ID
<5c05094a-5563-d55a-ea12-7dd74cd22fca@github.com>
In-Reply-To
<YqkcEhQX4qm7fSer@nand.local>
On 6/14/22 7:38 PM, Taylor Blau wrote:
> On Tue, Jun 14, 2022 at 09:27:48PM +0000, Derrick Stolee via GitGitGadget wrote:
Show 23 quoted lines
>> -		git repack --cruft -d &&
>> +		# Write a cruft pack instead of deleting files.
>> +		git gc --cruft &&
> 
> These ("git repack --cruft -d" and "git gc --cruft") do the same thing,
> so this transformation makes sense.
> 
> It may be slightly clearer to refer to "objects" instead of "files",
> perhaps like:
> 
>     # Write a cruft pack containing all unreachable objects
> 
> and then replace:
> 
>> +		# Ignore the cruft pack and delete every unreachable object.
>>  		git gc --cruft --prune=now &&
> 
> with:
> 
>     # Prune all unreachable objects from the cruft pack
> 
> But I don't think the current wording is a problem, either, so feel free
> to take or leave these suggestions.
I like your suggestions. I'll update them if there are other reasons
to do a v2.
 
Show 6 quoted lines
> Quoting from your original coverage report, this should take care of:
> 
> Taylor Blau     5b92477f builtin/gc.c: conditionally avoid pruning objects via loose
> builtin/gc.c
> 5b92477f 337) strvec_push(&repack, "--cruft");
> 5b92477f 338) if (prune_expire)
These lines, yes.
> 5b92477f 339) strvec_pushf(&repack, "--cruft-expiration=%s", prune_expire);

This one requires "git gc --cruft --prune=<time>" where <time> is not "now". I didn't want to jump too much into the exact expire time as I feared that could cause some issues, but I suppose passing --prune="01-01-1980" would provide a non-zero expiration and then lead to us testing "git repack --cruft --cruft-expiration" as well. (It doesn't actually test the exact expiration time, but does test that the options are sent down the pipe.)

Thanks, -Stolee

Previous: Taylor BlauNext: Derrick Stolee via GitGitGadget
Message 7 of 15 in “Reactions to v2.37.0-rc0 test coverage report”
  1. 0/4 Reactions to v2.37.0-rc0 test coverage reportDerrick Stolee via GitGitGadget, Jun 14, 2022
  2. 1/4 t2107: test 'git update-index --verbose'Derrick Stolee via GitGitGadget, Jun 14, 2022
  3. Eric SunshineJun 15, 2022
  4. Derrick StoleeJun 16, 2022
  5. 2/4 t5329: test 'git gc --cruft' without '--prune=now'Derrick Stolee via GitGitGadget, Jun 14, 2022
  6. Taylor BlauJun 14, 2022
  7. Derrick StoleeJun 15, 2022
  8. 3/4 pack-write: drop always-NULL parameterDerrick Stolee via GitGitGadget, Jun 14, 2022
  9. 4/4 cache-tree: remove cache_tree_find_path()Derrick Stolee via GitGitGadget, Jun 14, 2022
  10. 0/4 Reactions to v2.37.0-rc0 test coverage reportDerrick Stolee via GitGitGadget, Jun 16, 2022
  11. 1/4 t2107: test 'git update-index --verbose'Derrick Stolee via GitGitGadget, Jun 16, 2022
  12. 2/4 t5329: test 'git gc --cruft' without '--prune=now'Derrick Stolee via GitGitGadget, Jun 16, 2022
  13. 3/4 pack-write: drop always-NULL parameterDerrick Stolee via GitGitGadget, Jun 16, 2022
  14. 4/4 cache-tree: remove cache_tree_find_path()Derrick Stolee via GitGitGadget, Jun 16, 2022
  15. Junio C HamanoJun 16, 2022

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.