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

Re: [PATCH 2/2] introduce "preciousObjects" repository extension

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 24, 2015, 10:29 UTC
Message-ID
<CACsJy8Ca4J4Q4zi2i-HmySK6WXcNLo=oUZ9H=nPpms7VWhHe1Q@mail.gmail.com>
In-Reply-To
<20150624081224.GA4781@peff.net>
On Wed, Jun 24, 2015 at 3:12 PM, Jeff King <peff@peff.net> wrote:
Show 36 quoted lines
> On Tue, Jun 23, 2015 at 06:54:11AM -0400, Jeff King wrote:
>
>> diff --git a/builtin/prune.c b/builtin/prune.c
>> index 0c73246..fc0c8e8 100644
>> --- a/builtin/prune.c
>> +++ b/builtin/prune.c
>> @@ -218,6 +218,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
>>               return 0;
>>       }
>>
>> +     if (repository_format_precious_objects)
>> +             die("cannot prune in a precious-objects repo");
>> +
>
> By the way, I originally wrote this patch on an older version of git,
> and was surprised that `git gc` broke when I brought it forward. The
> problem was that gc now runs `git prune --worktree`, and my die() was
> affecting that case.
>
> It really seems misplaced to me to make worktree-pruning part of
> git-prune. I imagine the rationale was "well, we are pruning things, so
> let's add an option to this command rather than make a new one". But I
> do not think that follows our usual pattern with gc, which is:
>
>   1. Individual areas of code handle their own cleanup. E.g., "reflog
>      expire", "rerere gc".
>
>   2. We tie them together with "git gc", not with "git prune".
>
> So it seems weird that "git prune --worktree" is a fundamentally
> different command than "git prune". I think by (1), it should be a
> separate "git prune-worktree" (or better yet, "git worktree prune", as
> the start of a command for manipulating the list of multiple-worktrees).
>
> Not a _huge_ deal, but if we want to change it, it would be nice to do so
> now before it is part of a release. Thoughts?

I was misled by the generic name "prune" :) (OK my bad, the document clearly says it's about object database). Maybe we should make an alias prune-objects.. And you caught me too late, I also added prune_shallow() in there.

Multiple worktree feature is not released yet so I still have some time to move it out. Yeah "git worktree prune" makes sense. I think I need a way to list worktrees anyway. I didn't find good enough reason to create "git worktree" back then just for listing..

-- 
Duy
Previous: Jeff King
Message 13 of 13 in “bumping repository format version”
  1. 0/2 bumping repository format versionJeff King, Jun 23, 2015
  2. 1/2 introduce "extensions" form of core.repositoryformatversionJeff King, Jun 23, 2015
  3. 2/2 introduce "preciousObjects" repository extensionJeff King, Jun 23, 2015
  4. Duy NguyenJun 23, 2015
  5. Jeff KingJun 23, 2015
  6. Junio C HamanoJun 23, 2015
  7. Jeff KingJun 24, 2015
  8. Junio C HamanoJun 24, 2015
  9. Jeff KingJun 25, 2015
  10. David TurnerJun 23, 2015
  11. Jeff KingJun 24, 2015
  12. Jeff KingJun 24, 2015
  13. Duy NguyenJun 24, 2015

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.