From: "Shawn O. Pearce" <spearce@spearce.org>
To: Theodore Tso <tytso@mit.edu>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Petr Baudis <pasky@suse.cz>,
git@vger.kernel.org
Subject: Re: repo.or.cz wishes?
Date: Fri, 31 Aug 2007 17:09:39 -0400 [thread overview]
Message-ID: <20070831210938.GC18160@spearce.org> (raw)
In-Reply-To: <20070829111345.GD29615@thunk.org>
Theodore Tso <tytso@mit.edu> wrote:
> On Wed, Aug 29, 2007 at 12:15:23AM -0400, Shawn O. Pearce wrote:
> > >
> > > git --git-dir=A gc
> > > ln A/.git/objects/pack/* B/.git/objects/pack
> > > git --git-dir=B gc --prune
> > > git --git-dir=A prune
> >
> > No, it won't work.
> >
> > The problem is that during the first `git --git-dir=A gc` call
> > you are deleting packfiles that may contain objects that B needs.
> > *poof*.
>
> But "git-gc" without the --prune doesn't delete any objects.
Yes, it does delete objects. Even without --prune. That is
because git-gc is running `git-repack -a -d -l`. repack -a means
repack all objects reachable from the current refs. The -d means
delete the packfiles that existed when the repack started, as it
is assumed that all needed (reachable) objects were copied into
the new output packfile(s). The -d also means delete any loose
objects that are now packed (git-prune-packed).
Yet there may be objects in A that A cannot reach anymore (deleted
or rewound branch) but that B needs and B does not have a copy of.
If these objects were in one of the prior packfiles of A and is
not in the new packfile(s) of A then those objects are gone. *poof*.
> So it
> should always be safe to use git-gc even if there are repositories
> that are relying on that repo's ODB. It's only if you use git-gc
> --prune that you could get in troudble. It might delete some
> packfiles containing objects needed by B, but only after consolidating
> all of the objects into a single packfile that contains all of the
> objects that had always been in A's ODB.
But when we repack we don't repack everything in A's ODB, we only
repack the things that A can reach. If A cannot reach something
because a branch was rewound or deleted it won't survive the repack.
Then the repack is behaving like at least partially like gc --prune.
> So I don't see why this wouldn't work.
It only works if A cannot delete a branch or rewind a branch.
In other words, once an object is stored in A's ODB it must always
be reachable from A's refs.
--
Shawn.
next prev parent reply other threads:[~2007-08-31 21:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-26 23:59 repo.or.cz wishes? Petr Baudis
2007-08-27 0:16 ` Sven Verdoolaege
2007-08-27 0:41 ` Petr Baudis
2007-08-27 18:23 ` Linus Torvalds
2007-08-27 18:58 ` Junio C Hamano
2007-08-27 19:09 ` Matthieu Moy
2007-08-27 20:05 ` Martin Mares
2007-08-27 21:27 ` Jing Xue
2007-08-27 22:27 ` Linus Torvalds
2007-08-27 22:58 ` Sam Vilain
2007-08-27 23:17 ` Linus Torvalds
2007-08-27 23:27 ` Jakub Narebski
2007-08-27 23:38 ` Linus Torvalds
2007-08-27 23:30 ` Sam Vilain
2007-08-27 23:34 ` Linus Torvalds
2007-08-27 23:16 ` Jakub Narebski
2007-08-27 21:58 ` Jakub Narebski
[not found] ` <20070828084939.GF1976MdfPADPa@greensroom.kotnet.org>
[not found] ` <200708282356.10605.jnareb@gmail.com>
2007-08-29 7:32 ` Sven Verdoolaege
2007-08-29 23:12 ` Jakub Narebski
2007-08-27 2:40 ` Sam Vilain
2007-08-27 8:35 ` Johannes Schindelin
[not found] ` <20070828041059.GK18160@spearce.org>
[not found] ` <20070828111913.GA31120@thunk.org>
[not found] ` <Pine.LNX.4.64.0708281230310.28586@racer.site>
[not found] ` <20070829042005.GT18160@spearce.org>
2007-08-29 9:54 ` Petr Baudis
[not found] ` <20070829041523.GS18160@spearce.org>
[not found] ` <7vr6lnszay.fsf@gitster.siamese.dyndns.org>
2007-08-29 9:58 ` Petr Baudis
2007-08-29 11:13 ` Theodore Tso
2007-08-31 21:09 ` Shawn O. Pearce [this message]
2007-08-29 17:11 ` Linus Torvalds
2007-09-01 2:58 ` Shawn O. Pearce
2007-08-27 19:49 ` Uwe Kleine-König
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=20070831210938.GC18160@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
--cc=tytso@mit.edu \
/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).