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

Re: git-daemon on NSLU2

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 26, 2007, 17:15 UTC
Message-ID
<alpine.LFD.0.999.0708260959050.25853@woody.linux-foundation.org>
In-Reply-To
<9e4733910708260934i1381e73ftb31c7de0d23f6cae@mail.gmail.com>
On Sun, 26 Aug 2007, Jon Smirl wrote:
> 
> Changing git-daemon only for the initial clone case also means that
> people don't need to change the way they manage packs.

I do agree that we might want to do some special-case handling for the initial clone (because it *is* kind of special), but it's not necessarily as easy as just re-using an existing pack.

At a minimum, we'd need to have something that knows how to make a single pack out of several packs and some loose objects. That shouldn't be *hard*, but it's certainly nontrivial, especially in the presense of the same objects possibly being available more than once in different packs.

[ The "duplicate object" thing does actually happen: even if you use only 
  "git native" protocols, you can get duplicate objects because a file was 
  changed back to an earlier version. The incremental packs you get from 
  push/pull'ing between two repositories try to send the minimal 
  incremental changes, but the keyword here is _try_: they will 
  potentially send objects that the receiver already has, if it's not 
  obvious that the receiver has them from the "commit boundary" cases ]

Maybe the client side will handle a pack with duplicate objects perfectly fine, and it's not an issue. Maybe. It might even be likely (I can't think of anything that would obviously break). But at a minimum, it would be something that needs some code on the sending side, and a lot of verification that the end result works ok on the receiving side.

And there's actually a deeper problem: the current native protocol guarantees that the objects sent over are only those that are reachable. That matters. It matters for subtle security issues (maybe you are exporting some repository that was rebased, and has objects that you didn't *intend* to make public!), but it also matters for issues like git "alternates" files.

If you only ever look at a single repo, you'll never see the alternates issue, but if you're seriously looking at serving git repositories, I don't really see the "single repo" case as being at all the most common or interesting case.

And if you look at something like kernel.org, the "alternates" thing is *much* more important than how much memory git-daemon uses! Yes, kernel.org would probably be much happier if git-daemon wasn't such a memory pig occasionally, but on the other hand, the win from using alternates and being able to share 99% of all objects in all the various related kernel repositories is actually likely to be a *bigger* memory win than any git-daemon memory usage, because now the disk caching works a hell of a lot better!

So it's not actually clear how the initial clone thing can be optimized on the server side.

It's easier to optimize on the *client* side: just do the initial clone with rsync/http (and "git gc" it on the client afterwards), and then change it to the git native protocol after the clone.

That may not sound very user-friendly, but let's face it, I think there is exactly one person in the whole universe that tries to use an NSLU2 as a git server. So the "client-side workaround" is likely to affect a very limited number of clients ;)

		Linus
Previous: Jon SmirlNext: Jon Smirl
Message 20 of 30 in “git-daemon on NSLU2”
  1. Jon SmirlAug 24, 2007
  2. Shawn O. PearceAug 24, 2007
  3. Jon SmirlAug 24, 2007
  4. Nicolas PitreAug 24, 2007
  5. Jon SmirlAug 24, 2007
  6. Nicolas PitreAug 24, 2007
  7. Jon SmirlAug 24, 2007
  8. Jakub NarebskiAug 24, 2007
  9. Junio C HamanoAug 24, 2007
  10. Jakub NarebskiAug 24, 2007
  11. Jon SmirlAug 24, 2007
  12. Junio C HamanoAug 25, 2007
  13. David KastrupAug 25, 2007
  14. Salikh ZakirovAug 25, 2007
  15. Nicolas PitreAug 25, 2007
  16. Linus TorvaldsAug 24, 2007
  17. Jon SmirlAug 25, 2007
  18. Jeff KingAug 26, 2007
  19. Jon SmirlAug 26, 2007
  20. Linus TorvaldsAug 26, 2007
  21. Jon SmirlAug 26, 2007
  22. Linus TorvaldsAug 26, 2007
  23. Jon SmirlAug 26, 2007
  24. Linus TorvaldsAug 26, 2007
  25. Junio C HamanoAug 26, 2007
  26. Theodore TsoAug 27, 2007
  27. Linus TorvaldsAug 27, 2007
  28. Daniel HulmeAug 26, 2007
  29. Jakub NarebskiAug 27, 2007
  30. Jon SmirlAug 24, 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.