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

Re: [PATCH 1/2] builtin/repack.c: only repack `.pack`s that exist

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 11, 2023, 17:28 UTC
Message-ID
<ZK2RRdFYl6Vey7oV@nand.local>
In-Reply-To
<xmqqedlf4jg1.fsf@gitster.g>
On Mon, Jul 10, 2023 at 01:09:50PM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> >  		git config pack.window 0 &&
> >  		P1=$(commit_and_pack 1) &&
> >  		P2=$(commit_and_pack 2) &&
> >  		P3=$(commit_and_pack 3) &&
> >  		P4=$(commit_and_pack 4) &&
> > -		ls .git/objects/pack/*.pack >old-counts &&
> > +		find .git/objects/pack -name "*.pack" -type f | sort >old-counts &&
> >  		test_line_count = 4 old-counts &&
> >  		git repack -a -d --keep-pack $P1 --keep-pack $P4 &&
> > -		ls .git/objects/pack/*.pack >new-counts &&
> > +		find .git/objects/pack -name "*.pack" -type f | sort >new-counts &&
> >  		grep -q $P1 new-counts &&
> >  		grep -q $P4 new-counts &&
> >  		test_line_count = 3 new-counts &&
>
> I do not think "sort" in both of these added lines is doing anything
> useful.  Does the test break without this hunk and if so how?

This is an error on my part; I don't think I realized that a bare ls gives sorted output, so changing these to 'find ... | sort' was unnecessary. I'll send a version that removes that noise.

Thanks, Taylor

Previous: Junio C HamanoNext: Taylor Blau
Message 4 of 10 in “repack: make `collect_pack_filenames()` consistent”
  1. 0/2 repack: make `collect_pack_filenames()` consistentTaylor Blau, Jul 10, 2023
  2. 1/2 builtin/repack.c: only repack `.pack`s that existTaylor Blau, Jul 10, 2023
  3. Junio C HamanoJul 10, 2023
  4. Taylor BlauJul 11, 2023
  5. 2/2 builtin/repack.c: avoid dir traversal in `collect_pack_filenames()`Taylor Blau, Jul 10, 2023
  6. Junio C HamanoJul 10, 2023
  7. Taylor BlauJul 11, 2023
  8. 0/2 repack: make `collect_pack_filenames()` consistentTaylor Blau, Jul 11, 2023
  9. 1/2 builtin/repack.c: only repack `.pack`s that existTaylor Blau, Jul 11, 2023
  10. 2/2 builtin/repack.c: avoid dir traversal in `collect_pack_filenames()`Taylor Blau, Jul 11, 2023

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.