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

Re: [RFC] Zit: the git-based single file content tracker

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Oct 24, 2008, 19:42 UTC
Message-ID
<cb7bb73a0810241242y7467f6fexcca4b7cd768e7992@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.10.0810241159290.27333@asgard.lang.hm>

I was slowly writing a reply but it seems David beat me to it, so here goes a couple of additional comments.

On Fri, Oct 24, 2008 at 9:11 PM,  <david@lang.hm> wrote:
Show 9 quoted lines
> On Fri, 24 Oct 2008, Junio C Hamano wrote:
>> Running "git init" in an empty directory consumes about 100k of diskspace
>> on the machine I am typing this on, and you should be able to share most
>> of them (except one 41-byte file that is the branch tip ref) when you
>> track many files inside a single directory by using a single repository,
>> one branch per file (or "one set of branches per file") model.
>
> the reason to use seperate repos is to ease the work involved if you need to
> move that file (and it's repo) elsewhere.

Precisely. The one-repo-per-file is just the simplest and most flexible solution. But yes, I have to admit I hadn't looked into disk usage, and indeed we should try and squeeze this as much as possible.

> with the git directory being under .zit, would it be possible to link the
> things that are nessasary togeather?
I'm not sure about _which_ files could be shared.
> hmm, looking at this in more detail.
>
> about 44K of diskspace is used by the .sample hook files, so those can be
> removed

Exactly. I'm setting up zit to prepare its repos to a more compact form, and getting rid of hooks and description is the first step.

Show 26 quoted lines
> the remaining 56K is mostly directories eating up a disk block
>
> find . -ls
> 200367    4 drwxr-xr-x   7 dlang    users        4096 Oct 24 12:00 .
> 200368    4 drwxr-xr-x   4 dlang    users        4096 Oct 24 12:00 ./refs
> 200369    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00
> ./refs/heads
> 200370    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00
> ./refs/tags
> 200371    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00
> ./branches
> 200372    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00 ./hooks
> 200373    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00 ./info
> 1798469   4 -rw-r--r--   1 dlang    users         240 Oct 24 12:00
> ./info/exclude
> 1600716   4 -rw-r--r--   1 dlang    users          58 Oct 24 12:00
> ./description
> 200374    4 drwxr-xr-x   4 dlang    users        4096 Oct 24 12:00 ./objects
> 200375    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00
> ./objects/pack
> 200376    4 drwxr-xr-x   2 dlang    users        4096 Oct 24 12:00
> ./objects/info
> 1600717   4 -rw-r--r--   1 dlang    users          23 Oct 24 12:00 ./HEAD
> 1600719   4 -rw-r--r--   1 dlang    users          92 Oct 24 12:00 ./config
>
> how many of these are _really_ nessasary?

For starters, I'm wondering if setting core.preferSymlinkRefs would be useful here. Does it break sometihng?

> tags, info, hooks, branches, and description could probably be skipped for
> the common zit case, as long as they can be created as needed.
It seems that tags, hooks, branches and description can be done with.

info contains exclude which is rather essential, and this is something that could be shared across repositories. Also, we could spare a block by removing info, moving exclude to the .git dir and setting core.excludesfile appropriately

> the objects directory will eat up more space as revisions are checked in
> (and more sub-directories are created), would it make sense to have a config
> option to do a flat objects directory instead of the current fan-out?

This is probably the biggest remaining spacewaste. Typical zit usage will generate a rather small number of objects, so flattening the object store for the repo wouldn't be a bad idea. Is that possible?

-- 
Giuseppe "Oblomov" Bilotta
Previous: david@lang.hmNext: david@lang.hm
Message 28 of 38 in “[RFC] Zit: the git-based single file content tracker”
  1. Giuseppe BilottaOct 23, 2008
  2. Felipe Oliveira CarvalhoOct 23, 2008
  3. Nguyen Thai Ngoc DuyOct 23, 2008
  4. Giuseppe BilottaOct 23, 2008
  5. Nguyen Thai Ngoc DuyOct 23, 2008
  6. Giuseppe BilottaOct 23, 2008
  7. Johannes SixtOct 23, 2008
  8. Giuseppe BilottaOct 23, 2008
  9. Johannes SchindelinOct 24, 2008
  10. Giuseppe BilottaOct 24, 2008
  11. [RFC] Zit (v2): the git-based single file content trackerGiuseppe Bilotta, Oct 23, 2008
  12. david@lang.hmOct 24, 2008
  13. Giuseppe BilottaOct 24, 2008
  14. Jakub NarebskiOct 24, 2008
  15. Giuseppe BilottaOct 24, 2008
  16. Jakub NarebskiOct 26, 2008
  17. Giuseppe BilottaOct 26, 2008
  18. Jakub NarebskiOct 26, 2008
  19. Giuseppe BilottaOct 26, 2008
  20. Jean-Luc HerrenOct 23, 2008
  21. Giuseppe BilottaOct 24, 2008
  22. Jakub NarebskiOct 24, 2008
  23. Giuseppe BilottaOct 24, 2008
  24. Jakub NarebskiOct 24, 2008
  25. Giuseppe BilottaOct 24, 2008
  26. Junio C HamanoOct 24, 2008
  27. david@lang.hmOct 24, 2008
  28. Giuseppe BilottaOct 24, 2008
  29. david@lang.hmOct 24, 2008
  30. Giuseppe BilottaOct 24, 2008
  31. david@lang.hmOct 24, 2008
  32. Giuseppe BilottaOct 24, 2008
  33. Jakub NarebskiOct 24, 2008
  34. Giuseppe BilottaOct 25, 2008
  35. Jakub NarebskiOct 25, 2008
  36. Giuseppe BilottaOct 25, 2008
  37. david@lang.hmOct 24, 2008
  38. Giuseppe BilottaOct 24, 2008

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.