From: Duy Nguyen <pclouds@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] introduce "preciousObjects" repository extension
Date: Wed, 24 Jun 2015 17:29:42 +0700 [thread overview]
Message-ID: <CACsJy8Ca4J4Q4zi2i-HmySK6WXcNLo=oUZ9H=nPpms7VWhHe1Q@mail.gmail.com> (raw)
In-Reply-To: <20150624081224.GA4781@peff.net>
On Wed, Jun 24, 2015 at 3:12 PM, Jeff King <peff@peff.net> wrote:
> 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
prev parent reply other threads:[~2015-06-24 10:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 10:50 [RFC/PATCH 0/2] bumping repository format version Jeff King
2015-06-23 10:53 ` [PATCH 1/2] introduce "extensions" form of core.repositoryformatversion Jeff King
2015-06-23 10:54 ` [PATCH 2/2] introduce "preciousObjects" repository extension Jeff King
2015-06-23 11:14 ` Duy Nguyen
2015-06-23 11:47 ` Jeff King
2015-06-23 21:05 ` Junio C Hamano
2015-06-24 7:50 ` Jeff King
2015-06-24 17:15 ` Junio C Hamano
2015-06-25 10:07 ` Jeff King
2015-06-23 21:31 ` David Turner
2015-06-24 7:55 ` Jeff King
2015-06-24 8:12 ` Jeff King
2015-06-24 10:29 ` Duy Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACsJy8Ca4J4Q4zi2i-HmySK6WXcNLo=oUZ9H=nPpms7VWhHe1Q@mail.gmail.com' \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).