git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eran Tromer <git2eran@tromer.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] repack: allow simultaneous packing and pruning
Date: Wed, 11 Oct 2006 01:45:22 +0200	[thread overview]
Message-ID: <452C3092.7090003@tromer.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0610101524050.3952@g5.osdl.org>

On 2006-10-11 00:27, Linus Torvalds wrote:
> Those unreferenced objects are old history that won't be part of any new 
> history.
> 
> If you create new history, they won't be in the pack.

... because git-repack moves only already-referenced objects to packs
(and once they're referenced a subsequent "git-repack -a -d" won't lose
them). Curiously, this critically depends on Documentation/git-repack
being wrong:

  This script is used to combine all objects that do not currently
  reside in a "pack", into a pack.

However, this means there is no safe way to create a new pack without
adding all its content as loose objects first.

For example, the following is racy because there's a point where the new
pack is on disk but not yet referenced:

$ git-fetch --keep foo &  git-repack -a -d


>> But "git prune" does not GC packs, only loose objects.
> 
> Right. And you'd want to repack _and_ prune, but they should be kept 
> separate, because one is safe, the other is not.

Ah, semantics.

The request was for removing unreferenced objects ("pruning") in *packs*
while doing the repacking. This turns out to be already implemented
(contrary to the docs) and, as you explained, safe.

Pruning both packed and loose objects while repacking is neither safe
nor requested (and is indeed roughly equivalent to just
"git-repack -a -d; git-prune").


  Eran

  reply	other threads:[~2006-10-10 23:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 10:14 [PATCH] repack: allow simultaneous packing and pruning Sam Vilain
2006-10-10 11:04 ` Sam Vilain
2006-10-10 15:03 ` Linus Torvalds
2006-10-10 19:46   ` Eran Tromer
2006-10-10 21:25     ` Linus Torvalds
2006-10-10 22:09       ` Eran Tromer
2006-10-10 22:27         ` Linus Torvalds
2006-10-10 23:45           ` Eran Tromer [this message]
2006-10-10 20:24   ` Junio C Hamano

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=452C3092.7090003@tromer.org \
    --to=git2eran@tromer.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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).