From: Jeff King <peff@peff.net>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Andreas Amann <a.amann@ucc.ie>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: problem with modification time of packfiles
Date: Mon, 19 Oct 2015 19:52:30 -0400 [thread overview]
Message-ID: <20151019235230.GA14800@sigill.intra.peff.net> (raw)
In-Reply-To: <20151019230919.GA60184@vauxhall.crustytoothpaste.net>
On Mon, Oct 19, 2015 at 11:09:19PM +0000, brian m. carlson wrote:
> On Mon, Oct 19, 2015 at 08:59:15PM +0100, Andreas Amann wrote:
> > Thank you for your answer. However, this reasoning only applies to loose
> > objects and not packfiles.
> >
> > My understanding is that "git prune" will not prune any pack files
> > (except those starting with tmp_). Only "git repack" should do that.
> > Repack seems to be however mtime agnostic and therefore it does not seem
> > to be necessary to freshen packfiles.
> >
> > It therefore seems that git freshens packfiles unnecessarily, which can
> > lead to expensive and unnecessary backup operations.
> >
> > Given this, would a trivial patch to remove the freshening of packfiles
> > be acceptable?
>
> I'm not familiar enough with the code to say for certain, but it looks
> like you're right. Peff, Junio, do you think this is safe, or is there
> something we're missing?
No, it's not safe. When doing a full repack, we pack only reachable
objects. Unreachable ones are either loosened and given the mtime of the
packfile (from which they can then be pruned), or discarded if the pack
mtime is already old (as an optimization to avoid writing and then
immediately pruning).
See builtin/pack-objects.c:loosen_unused_packed_objects.
-Peff
prev parent reply other threads:[~2015-10-19 23:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-18 21:37 problem with modification time of packfiles Andreas Amann
2015-10-19 2:57 ` brian m. carlson
2015-10-19 19:59 ` Andreas Amann
2015-10-19 23:09 ` brian m. carlson
2015-10-19 23:52 ` 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=20151019235230.GA14800@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=a.amann@ucc.ie \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.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.
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).