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

Re: Sparse clones (Was: Re: [PATCH 1/2] upload-pack: support subtree packing)

From
EWEnrico Weigelt <weigelt@metux.de>
Date
Aug 13, 2010, 17:31 UTC
Message-ID
<20100813173147.GB27540@nibiru.local>
In-Reply-To
<AANLkTikJhSVJw2hXkp0j6XA+k-J-AtSYzKWumjnqqsgz@mail.gmail.com>
* Elijah Newren <newren@gmail.com> wrote:
Hi folks,

as I'm doing many backups via git (eg. hourly sql dumps), I'd like to cut off the history (eg. at the n'th past commit) and reclaim the space - both on local and remote side (even differently).

So let me propose another approach: fake-root's

Fake-roots are special refs that declare certain commit objects as root-commits). Each time git walks down the history, it checks whether the current commit is an fake-root and so treats it as having no ancestor. That should be generic enough let everything else (commit, push, gc, etc) work as usual.

The only tricky point is when to update remote fake-roots: the remote should not cut off my local repo (unless explicitly asked). So remote fake-roots should only be imported if the local/receiving side has not the dropped commits anymore.

hmm, maybe it's even more wise to get one step back in history and introduce fake-empty's (which also have no parents) instead of fake-root's ? A fake-empty is imported as soon as the original object is missing.

Of course, it's important that this feature has to be explicitly enabled (maybe even on per-remote basis) to prevent security flaws.

cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
Previous: Nguyen Thai Ngoc DuyNext: Jonathan Nieder
Message 15 of 16 in “Sparse clones (Was: Re: [PATCH 1/2] upload-pack: support subtree packing)”
  1. Elijah NewrenJul 28, 2010
  2. Avery PennarunJul 28, 2010
  3. Nguyen Thai Ngoc DuyJul 28, 2010
  4. Nguyen Thai Ngoc DuyJul 28, 2010
  5. Avery PennarunJul 28, 2010
  6. Sverre RabbelierJul 28, 2010
  7. Nguyen Thai Ngoc DuyJul 28, 2010
  8. Sverre RabbelierJul 28, 2010
  9. Nguyen Thai Ngoc DuyJul 28, 2010
  10. Elijah NewrenJul 28, 2010
  11. Elijah NewrenJul 31, 2010
  12. Nguyen Thai Ngoc DuyJul 28, 2010
  13. Elijah NewrenJul 28, 2010
  14. Nguyen Thai Ngoc DuyJul 29, 2010
  15. Enrico WeigeltAug 13, 2010
  16. Truncating history (Re: Sparse clones)Jonathan Nieder, Aug 13, 2010

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.