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

Re: [PATCH v3 2/3] multi-pack-index: respect repack.packKeptObjects=false

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
May 10, 2020, 06:38 UTC
Message-ID
<20200510063844.GA14311@danh.dev>
In-Reply-To
<xmqqlfm1ui6t.fsf@gitster.c.googlers.com>
On 2020-05-09 10:33:30-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:
> 
> > On 2020-05-09 14:24:29+0000, Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:
> >> From: Derrick Stolee <dstolee@microsoft.com>
> >> 
> >> +test_expect_success 'repack respects repack.packKeptObjects=false' '
> >> +	test_when_finished rm -f dup/.git/objects/pack/*keep &&
> >> +	(
> >> +		cd dup &&
> >> +		ls .git/objects/pack/*idx >idx-list &&
> >
> > I think ls(1) is an overkill.
> > I think:
> >
> > 	echo .git/objects/pack/*idx
> >
> > is more efficient.
> 
> When there is no file whose name ends with idx, what happens?
> 
>     $ ls *idx && echo OK
>     ls: cannot access '*idx': No such file or directory
>     $ echo *idx && echo OK
>     *idx
>     OK

Yes, but I think the next line is checking for the number of lines. This is better to fail faster.

(My suggestion was wrong anyway, it should be "printf "%s\\n" *idx)
Show 10 quoted lines
> >> +		test_line_count = 5 idx-list &&
> >> +		for keep in $(cat keep-list)
> >> +		do
> >> +			touch $keep || return 1
> >
> > Is this intended?
> > Since touch(1) accepts multiple files as argument.
> 
> Good suggestion, but doesn't .keep file record why the pack is kept
> in real life (i.e. not an empty file)?

Yes, in real life, we usually provide a reason in this .keep file. But, we also allow empty file with git-index-pack --keep I think simple touch is fine for this test.

Missing piece for my previous command: if `keep-list` is empty, we may want to fail fast, touch with empty list will error out (at least in my system).

-- 
Danh
Previous: Junio C HamanoNext: Son Luong Ngoc
Message 22 of 26 in “midx: apply gitconfig to midx repack”
  1. midx: apply gitconfig to midx repackSon Luong Ngoc via GitGitGadget, May 5, 2020
  2. Derrick StoleeMay 5, 2020
  3. Son Luong NgocMay 5, 2020
  4. Son Luong NgocMay 6, 2020
  5. 0/2 midx: apply gitconfig to midx repackSon Luong Ngoc via GitGitGadget, May 6, 2020
  6. 1/2 midx: apply gitconfig to midx repackSon Luong Ngoc via GitGitGadget, May 6, 2020
  7. Derrick StoleeMay 6, 2020
  8. Junio C HamanoMay 6, 2020
  9. Son Luong NgocMay 7, 2020
  10. 2/2 multi-pack-index: respect repack.packKeptObjects=falseDerrick Stolee via GitGitGadget, May 6, 2020
  11. Eric SunshineMay 6, 2020
  12. Derrick StoleeMay 6, 2020
  13. 0/3 midx: apply gitconfig to midx repackSon Luong Ngoc via GitGitGadget, May 9, 2020
  14. 1/3 midx: teach "git multi-pack-index repack" honor "git repack" configurationsSon Luong Ngoc via GitGitGadget, May 9, 2020
  15. Junio C HamanoMay 9, 2020
  16. Son Luong NgocMay 10, 2020
  17. 3/3 Ensured t5319 follows arith expansion guidelineSon Luong Ngoc via GitGitGadget, May 9, 2020
  18. Junio C HamanoMay 9, 2020
  19. 2/3 multi-pack-index: respect repack.packKeptObjects=falseDerrick Stolee via GitGitGadget, May 9, 2020
  20. Đoàn Trần Công DanhMay 9, 2020
  21. Junio C HamanoMay 9, 2020
  22. Đoàn Trần Công DanhMay 10, 2020
  23. Son Luong NgocMay 10, 2020
  24. 0/2 midx: apply gitconfig to midx repackSon Luong Ngoc via GitGitGadget, May 10, 2020
  25. 1/2 midx: teach "git multi-pack-index repack" honor "git repack" configurationsSon Luong Ngoc via GitGitGadget, May 10, 2020
  26. 2/2 multi-pack-index: respect repack.packKeptObjects=falseDerrick Stolee via GitGitGadget, May 10, 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.