git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Alternates and broken repos: A pack and prune scheme to avoid them
@ 2007-11-18 11:25 Johannes Sixt
  2007-11-18 18:39 ` Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Sixt @ 2007-11-18 11:25 UTC (permalink / raw)
  To: git

As you know, repo.or.cz uses alternates in order to reduce the space that the 
repositories of forked projects require.

Recently, it happened that a fork (4msysgit.git) became broken because it was 
using an object that was pruned away from the repository that it was 
borrowing from (mingw.git). This happened even though 4msysgit did not use 
the branch of mingw.git that was rebased and whose objects were pruned. The 
reason is that a merge in 4msysgit.git resulted in a blob that was also in 
the rebased branch.

To avoid such situations I propose to introduce "attic" packs. They contain 
objects that are unreachable by the local set of refs. Otherwise they are 
used like regular packs.

git-repack produces "attic" packs like this:

- Places objects of the local object store that are unreachable in an "attic" 
pack.
- Copies objects that are reachable but borrowed from an alternate and are 
only in the alternates' "attic" packs into the local regular pack.

git-prune removes "attic" packs.

Then the strategy of garbage collection can be arranged in the following way:

- Repack by starting at the "most complete" repo and work towards the "most 
borrowing" ones. During this phase "attic" packs are created. Borrowing repos 
get a chance to salvage objects before the alternates prune them away.

- Prune by starting at the "most borrowing" repo and work towards the "most 
complete" ones. During this phase the "attic" packs are cleaned up.

What do you think? Is this a way for a solution?

-- Hannes

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-29 21:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 11:25 [RFC] Alternates and broken repos: A pack and prune scheme to avoid them Johannes Sixt
2007-11-18 18:39 ` Junio C Hamano
2007-11-18 20:01   ` Johannes Sixt
2007-11-18 20:10     ` Junio C Hamano
2007-11-29  3:41       ` [PATCH/RFC] Teach repack to optionally retain otherwise lost objects Johannes Schindelin
2007-11-29  6:15         ` Junio C Hamano
2007-11-29 11:57           ` Johannes Schindelin
2007-11-29 14:21             ` [PATCH] Add "--expire <time>" option to 'git prune' Johannes Schindelin
2007-11-29 14:35               ` Johannes Sixt
2007-11-29 15:22                 ` [PATCH v2] " Johannes Schindelin
2007-11-29 15:12               ` [PATCH] " Jeff King
2007-11-29 16:13                 ` Johannes Schindelin
2007-11-29 20:06               ` Junio C Hamano
2007-11-29 20:59                 ` Johannes Schindelin

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).