git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] introduce "preciousObjects" repository extension
Date: Thu, 25 Jun 2015 06:07:37 -0400	[thread overview]
Message-ID: <20150625100737.GA26795@peff.net> (raw)
In-Reply-To: <xmqqvbed9gf7.fsf@gitster.dls.corp.google.com>

On Wed, Jun 24, 2015 at 10:15:08AM -0700, Junio C Hamano wrote:

> > I agree that would be better. I originally just blocked all use of
> > git-repack, but at the last minute softened it to just "repack -d". I'm
> > not sure if that would actually help anyone in practice. Sure, doing
> > "git repack" without any options is not destructive, but I wonder if
> > anybody actually does it.
> 
> Hmph, if you cannot afford to lose objects that are unreachable from
> your refs (because you know your repository has borrowers) but are
> suffering from too many packs, wouldn't "repack -a" be the most
> natural thing to do?  Maybe I am biased, but "git gc" is not the
> first thing that comes to my mind in that situation.

My assumption was that people fall into one of two categories:

  - people who just run `git gc`

  - people who are doing something clever, and will use `git
    repack` to do a full repack after making sure it is safe to do so.

    E.g., after "clone -s", it might be OK to do:

      for i in ../*.git; do
        git fetch $i +refs/*:refs/remotes/$i/*
      done
      git -c extensions.preciousObjects=false repack -ad

    But only the user can make that decision; git does not know whether
    "../*.git" is the complete set of children.

Certainly "git repack -a" is a safe stopgap in the shared-object parent,
but eventually you will want to do the clever thing. :)

I think it is OK to use this patch as a starting point, and for people
to loosen the rules later if there is a combination of repack flags that
are safe to run but not covered by the current logic (there is no
regression, since preciousObjects is a new extension, and going forward
it is OK to allow new safe things to open up workflows, but not the
other way around).

It may even be that the current patch even allows any sane workflow; I
am only claiming that I did not think too hard on it, and tried to err
on the side of safety, and allowing the workflow above.

-Peff

  reply	other threads:[~2015-06-25 10:12 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 [this message]
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

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=20150625100737.GA26795@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).