git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] Alternates and broken repos: A pack and prune scheme to avoid them

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Nov 18, 2007, 11:25 UTC
Message-ID
<200711181225.52288.johannes.sixt@telecom.at>

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
Next: Junio C Hamano
Message 1 of 14 in “[RFC] Alternates and broken repos: A pack and prune scheme to avoid them”
  1. Johannes SixtNov 18, 2007
  2. Junio C HamanoNov 18, 2007
  3. Johannes SixtNov 18, 2007
  4. Junio C HamanoNov 18, 2007
  5. Teach repack to optionally retain otherwise lost objectsJohannes Schindelin, Nov 29, 2007
  6. Junio C HamanoNov 29, 2007
  7. Johannes SchindelinNov 29, 2007
  8. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007
  9. Johannes SixtNov 29, 2007
  10. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007
  11. Jeff KingNov 29, 2007
  12. Johannes SchindelinNov 29, 2007
  13. Junio C HamanoNov 29, 2007
  14. Add "--expire <time>" option to 'git prune'Johannes Schindelin, Nov 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.