3 ms·
This is absolutely awesome. I barely use Git myself - my use cases have pretty much been https://xkcd.com/1597/ https://xkcd.com/1597/ - but the two main featur
by exikyut 9y ago
This is absolutely awesome. I barely use Git myself - my use cases have pretty much been https://xkcd.com/1597/ https://xkcd.com/1597/ - but the two main features I have needed to use are --depth=1 (to download just recent files) and "just fetch this one file from this one directory".
--depth=1 occasionally breaks repos because of the way Git works. I THINK (don't cite!) that Git stores submodule information in the master repo's history. So when I do a depth=1 clone with something that has submodules, I literally don't receive the metadata about the submodule information. But now the local history I do have is borked, and the only way to really fix it is to rm -rf the destination and start again.
But it's typically directories with submodules that also have massive histories. Like ffmpeg, for example. Yay.
--
Git doesn't have a "just grab me this one file or directory over there" option. It would probably be possible, but would probably be a massive hack to implement without even considering the internal architecture of Git - I don't know how the packfile format works (been meaning to find out one of these days) but it does seem that it shoves multiple files into the same packfile databases.
--
Finally, I am really happy to hear that Fossil-NG is somehow (?!?) going to be able to import Git repositories. I never wanted to learn Git - I've been trucking along like the XKCD above, but somewhere along the way I realized that it just wasn't the superior architecture and was glad I'd never adopted it. At some point I hope to learn Fossil and Mercurial, with Git a begrudging afterthought.
I love how Git is referred to not once but twice as a _legacy_ client xD
- sigjuice 9y agoI have not tried it, but the one-liner to fetch a single file that is mentioned here https://stackoverflow.com/a/14610427/78720 https://stackoverflow.com/a/14610427/78720 seems plausible
- ketralnis 9y ago> Finally, I am really happy to hear that Fossil-NG is somehow (?!?) going to be able to import Git repositories If I'm understanding what you mean it's been able to do that for a long time, bidirectionally https://www.fossil-scm.org/xfer/doc/trunk/www/inout.wiki https://www.fossil-scm.org/xfer/doc/trunk/www/inout.wiki
- iveqy 9y agoWhen using --depth=1 with submodules, git tries to clone a submodule. Let's say its master branch to the depth of 1. However the super project does not point to a branch but to a sha1, so except when the master branch points to sha1, it will fail. Most often you can get away with --depth=100 or something like that, but what's really needed is a way to fetch a sha1 and not only branches and tags. This is however not as easy at it seems, since only sha1 that are accessible from any tag or branch should be allowed for fetching (otherwise we've a security hole). I'm not sure if this is implemented in git yet, and I'm not sure if all git hosting providers support it.
- Dylan16807 9y agoYou need intimate knowledge of a commit to know its sha1, so how would that be a security hole?