r/linux • • Nov 17 '17

Microsoft and GitHub team up to take Git virtual file system to macOS, Linux - With GVFS, a local replica of a Git repository is virtualized such that it contains metadata and only the source code files that have been explicitly retrieved - Microsoft modified Git to handle this virtual file system

[deleted] — view deleted post

430 Upvotes

262 comments sorted by

View all comments

46

u/DonSimon13 Nov 17 '17

I don't think I fully understand the benefits of this GVFS. Can someone ELI5?

90

u/neonshadow Nov 17 '17

You don't have to download the whole repo at once. Instead you dynamically download pieces as you need them. It's mainly meant for large repos.

9

u/[deleted] Nov 17 '17

Oh I would love this, I do some big-ish data work and our code base is small but examples large.

13

u/uep Nov 17 '17

If by examples, you mean your example data is large, I think you're probably better off with submodules. In my mind at least, this is really for giant monolithic codebases. As in, lots and lots of code in one repo, not so much binary data not related to execution. With submodules, you can separate binary blob data into its own repo, and do shallow clones.

6

u/NAN001 Nov 17 '17

Isn't downloading the whole repo a one-time cost? After that it justs retireves files modified right?

18

u/reddraggone9 Nov 17 '17

the Windows codebase has over 3.5 million files and is over 270 GB in size. The Git client was never designed to work with repos with that many files or that much content. You can see that in action when you run “git checkout” and it takes up to 3 hours, or even a simple “git status” takes almost 10 minutes to run. That’s assuming you can get past the “git clone”, which takes 12+ hours.

https://blogs.msdn.microsoft.com/devops/2017/02/03/announcing-gvfs-git-virtual-file-system/

2

u/NAN001 Nov 17 '17

Wow, doesn't scale indeed. How do they manage to keep the Linux kernel's source under such size?

18

u/frymaster Nov 17 '17

The Linux kernel is just the kernel, while the Windows codebase is the entirety of Windows

2

u/[deleted] Nov 19 '17

Including all the extra crap like the apps included with windows.

8

u/Mr_s3rius Nov 18 '17

The linux kernel is only 62000 files at 770MiB. That's one 300th of that Windows repo.

6

u/jmtd Nov 17 '17

Anyone working on that code base won't be touching 99.99% of it anyway. So it doesn't need to be in one repo.

5

u/[deleted] Nov 17 '17

Splitting repos across logical boundaries is tough for monolith code bases. We tried it for a large legacy php repo. Such a PitA.

4

u/nonchalantlarch Nov 18 '17

It's too bad nobody at Microsoft thought of that, they could have avoided investing all that time and money into this project...

3

u/[deleted] Nov 17 '17

It's a one time cost, sure, but I recall reading about MS's use case a while ago and they have repos hundreds of gigabytes large with hundreds of branches. Git was almost unusable if I recall correctly. A simple git status would take hours.

→ More replies (9)

24

u/Quabouter Nov 17 '17

"Plain" git requires you to download the entire repository - including all if it's history - when you want to do anything with it. With GVFS you only need to download whatever is actually needed for your current operation.

7

u/jpodster Nov 17 '17

Serious question; what advantage does this have over shallow clones?

https://www.perforce.com/blog/git-beyond-basics-using-shallow-clones

4

u/w2qw Nov 18 '17

You wouldn't be able to for example git blame a file in a shallow repo. Additionally a shallow clone at least downloads one revision.

3

u/[deleted] Nov 18 '17

shallow clones refers to not having the full history, you still get the whole tree. this is letting you get part of the tree.

1

u/digitalblemish Nov 17 '17

In what way would this be advantageous to me as a dev though? With storage and bandwidth being as cheap and plentiful as they are in the modern world?

12

u/MG2R Nov 17 '17

Take Google. Pretty much their entire codebase lives in a single repository (not git, but the idea stands). No fucking way you can fetch all of that easily. Given the amount of people they employ, the amount of extra infrastructure they'd require if everyone has to download the entire repo at once would be dumb.

→ More replies (6)

4

u/sadmatafaka Nov 17 '17

Some repos are 50 to 100 GB.

3

u/Inprobamur Nov 17 '17

Easier to casually contribute to massive projects?

→ More replies (2)

3

u/liquidpele Nov 17 '17

To me this is mostly a feature for people who need to check in binary blobs so if you have a history of 10,000 changes to a PDF you don't want to have to download 10,000 PDFs every time you clone.