git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Nasser Grainawi <nasser@codeaurora.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/3] repack --keep-unreachable
Date: Mon, 13 Jun 2016 00:33:14 -0400	[thread overview]
Message-ID: <20160613043313.GA29422@sigill.intra.peff.net> (raw)
In-Reply-To: <C04883EB-2170-47C3-94E7-AE13516FD0C0@codeaurora.org>

On Sun, Jun 12, 2016 at 07:43:27PM -0600, Nasser Grainawi wrote:

> On Jun 12, 2016, at 4:13 PM, Jeff King <peff@peff.net> wrote:
> > 
> >    At GitHub we actually have a patch to `repack` that keeps all
> >    objects, reachable or not, in the pack, and use it for all of our
> >    automated maintenance. Since we don't drop objects at all, we can't
> >    ever have such a race. Aside from some pathological cases, it wastes
> >    much less space than you'd expect. We turn the flag off for special
> >    cases (e.g., somebody has rewound history and wants to expunge a
> >    sensitive object).
> > 
> >    I'm happy to share the "keep everything" patch if you're interested.
> 
> We have the same kind of patch actually (for the same reason), but
> back on the shell implementation of repack. It'd be great if you could
> share your modern version.

Here is a cleaned-up version of what we run at GitHub (so this is a
concept that has been exercised for a few years in production, but I had
to forward port the patches a bit; I _probably_ didn't introduce any
bugs. :) ).

The heavy lifting is done by the existing --keep-unreachable option to
pack-objects, which Junio added a long time ago[1] in support of a safer
"gc --auto". But it doesn't look like we ever documented or exercised
it, and "gc --auto" ended up using the loosen-unreachable strategy
instead. In fact, the rest of that series seems to have been dropped; I
couldn't find any discussion on the list explaining it, or why this one
patch was kept (so I don't think anybody upstream has ever used this
code, but as I said, we have been doing so for a few years, so I feel
confident in it).

  [1/3]: repack: document --unpack-unreachable option
  [2/3]: repack: add --keep-unreachable option
  [3/3]: repack: extend --keep-unreachable to loose objects

-Peff

[1] http://article.gmane.org/gmane.comp.version-control.git/58413

  reply	other threads:[~2016-06-13  4:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-12 21:25 Repacking a repository uses up all available disk space Konstantin Ryabitsev
2016-06-12 21:38 ` Jeff King
2016-06-12 21:54   ` Konstantin Ryabitsev
2016-06-12 22:13     ` Jeff King
2016-06-13  0:24       ` Duy Nguyen
2016-06-13  4:58         ` Jeff King
2016-06-13  1:43       ` Nasser Grainawi
2016-06-13  4:33         ` Jeff King [this message]
2016-06-13  4:33           ` [PATCH 1/3] repack: document --unpack-unreachable option Jeff King
2016-06-13  4:36           ` [PATCH 2/3] repack: add --keep-unreachable option Jeff King
2016-06-13  4:38           ` [PATCH 3/3] repack: extend --keep-unreachable to loose objects Jeff King

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=20160613043313.GA29422@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=konstantin@linuxfoundation.org \
    --cc=nasser@codeaurora.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.
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).