git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Dmitry Neverov <dmitry.neverov@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Git gc removes all packs
Date: Fri, 27 Feb 2015 08:14:26 -0500	[thread overview]
Message-ID: <20150227131425.GA13005@peff.net> (raw)
In-Reply-To: <CAC+L6n3OFYsjm+5PMW3DBzJo7LnUsxRq1TRE4PMvFvWVG6DQ+A@mail.gmail.com>

On Fri, Feb 27, 2015 at 11:16:09AM +0100, Dmitry Neverov wrote:

> I followed your advice and removed a symlink ref from my repository.
> But didn't help.. automatic GC has just removed all packs again. May
> alternates cause such a behavior? Are any ways to make gc log
> somewhere why it removes packs?

If you have two repositories, A and B, and A points to B via alternates,
then you cannot safely run "git gc" in B unless it knows about all of
the refs in A. As we discussed before, symlinking the refs is not
enough, because those symlinks get stale. But nor is removing the
symlinks and just not knowing about the refs. :)

The only safe thing to do is to fetch all of the refs from A into B just
before running the gc (and consequently, you probably want to disable
gc.auto in B).

-Peff

      reply	other threads:[~2015-02-27 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 15:13 Git gc removes all packs Dmitry Neverov
2015-02-05 20:03 ` Jeff King
2015-02-17 16:39   ` Michael Haggerty
2015-02-17 16:55     ` Jeff King
2015-02-17 20:37       ` Michael Haggerty
2015-02-17 21:57         ` Junio C Hamano
2015-02-17 22:19           ` Michael Haggerty
2015-02-18  7:13             ` Junio C Hamano
2015-02-27 10:16   ` Dmitry Neverov
2015-02-27 13:14     ` Jeff King [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150227131425.GA13005@peff.net \
    --to=peff@peff.net \
    --cc=dmitry.neverov@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).