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

Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 7, 2013, 23:58 UTC
Message-ID
<CACsJy8DaHanuPxeHv5GNqomE4=XtnyyJDepoVP8PmY88t4Au=Q@mail.gmail.com>
In-Reply-To
<7vzjzg802d.fsf@alter.siamese.dyndns.org>
On Fri, Feb 8, 2013 at 1:12 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> I thought about that, but we may need to do extra stat() for loose
>> garbage as well. As it is now, garbage is complained loudly, which
>> gives me enough motivation to clean up, even without looking at how
>> much disk space it uses.
>
> I wouldn't call a single line "garbage: 4" exactly *loud*.  I also
> think that this is not about *motivating* you, but about giving
> more information to the users to help them assess the health of
> their repository themselves.
That's not the only line it prints:

error: garbage found: .git/objects/pack/pack-8074dfd2b01f494a30f02d0374baa57632d26fea.commits error: garbage found: .git/objects/pack/pack-834c9dccca7634c2b225db1b5050a980cb2c2de0.commits error: garbage found: .git/objects/pack/tmp_pack_G235da error: garbage found: .git/objects/pack/pack-8bdf298e9252573289cd4f1e83e80c9f261882a2.commits count: 604 size: 5576 in-pack: 172307 packs: 4 size-pack: 50421 prune-packable: 4 garbage: 4

> By the way, I wonder if we also want to notice .git/objects/garbage
> or .git/objects/ga/rbage if we are to do this?

I prefer not (for code simplicity) because we may need to catch .git/objects/pack/info/garbage too if we do that.

Show 8 quoted lines
>> +                     if (!has_extension(de->d_name, ".pack")) {
>> +                             report_pack_garbage(path, 0, NULL);
>> +                             continue;
>> +                     }
>
> Didn't I already say the logic should be inverted to whitelist the
> known ones?  Saying "Anything that is not '.pack' is bad" here is a
> direct opposite, I think.
I must have missed it. Will do.
>
> Add "A '.keep' file is OK" to this codeflow and see how it goes.
OK
-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 7 of 14 in “git-count-objects.txt: describe each line in -v output”
  1. 1/2 git-count-objects.txt: describe each line in -v outputNguyễn Thái Ngọc Duy, Feb 4, 2013
  2. 2/2 count-objects: report garbage files in .git/objects/pack directory tooNguyễn Thái Ngọc Duy, Feb 4, 2013
  3. Junio C HamanoFeb 4, 2013
  4. Junio C HamanoFeb 4, 2013
  5. Duy NguyenFeb 7, 2013
  6. Junio C HamanoFeb 7, 2013
  7. Duy NguyenFeb 7, 2013
  8. 0/3 count-objects improvementsNguyễn Thái Ngọc Duy, Feb 8, 2013
  9. 1/3 git-count-objects.txt: describe each line in -v outputNguyễn Thái Ngọc Duy, Feb 8, 2013
  10. 2/3 count-objects: report garbage files in pack directory tooNguyễn Thái Ngọc Duy, Feb 8, 2013
  11. Junio C HamanoFeb 8, 2013
  12. Duy NguyenFeb 9, 2013
  13. 3/3 count-objects: report how much disk space taken by garbage filesNguyễn Thái Ngọc Duy, Feb 8, 2013
  14. Junio C HamanoFeb 8, 2013

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.