git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin Langhoff" <martin.langhoff@gmail.com>
To: "Linus Torvalds" <torvalds@osdl.org>
Cc: "Martin Langhoff" <martin@catalyst.net.nz>, git@vger.kernel.org
Subject: Re: [RFC] git-fetch - repack in the background after fetching
Date: Tue, 30 May 2006 17:14:08 +1200	[thread overview]
Message-ID: <46a038f90605292214l241a86b8l31edfab010a38c5f@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0605292147010.5623@g5.osdl.org>

On 5/30/06, Linus Torvalds <torvalds@osdl.org> wrote:
> Repacking is, but "-d" is not necessarily.

Ok -- strawman knocked down. Next try...

> Some long-running (in git terms) git programs will look up the pack-files
> when they start, and if you repack after that, they won't see the new
> pack-file, but they _will_ notice that the unpacked files are no longer
> there, and will be very unhappy indeed.
>
> So the "-d" part really isn't necessarily safe.
>
> Of course, in -practice- you won't likely see this, and the archive itself
> is never corrupted, but concurrent git ops can fail due to it in theory,
> and quite frankly, that's not the kind of SCM I like to use.

Would it be safe to repack -a && sleep 180 && git prune-packed ?

> So either just do "git repack -a", or do things synchronously.

Which I take to mean 'prune synchronously'. So what about...

+
+if test $(git rev-list --unpacked --all | wc -l) -gt 1000
+then
+       echo "Repacking in the background"
+       git prune-packed
+       nice git repack -a -q &
+fi

this would mean that at any given time there's a bit of overlap
between packed and unpacked, but will be resolved over repeated
commands.




martin

  reply	other threads:[~2006-05-30  5:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-30  4:42 [RFC] git-fetch - repack in the background after fetching Martin Langhoff
2006-05-30  4:51 ` Linus Torvalds
2006-05-30  5:14   ` Martin Langhoff [this message]
2006-05-30  6:37   ` Daniel Barkalow
2006-05-30 14:53     ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2006-06-24 11:30 Martin Langhoff
2006-06-25  3:12 ` Junio C Hamano
2006-06-25  3:53 ` Linus Torvalds
2006-06-25  9:25   ` Johannes Schindelin
2006-06-25 17:29     ` Linus Torvalds
2006-06-25 17:53 linux

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=46a038f90605292214l241a86b8l31edfab010a38c5f@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=martin@catalyst.net.nz \
    --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).