Live data from Hacker News

Show HN: ugit – Learn Git Internals by Building Git in Python

leshenko.net

1–10 of 31 posts

Re: Show HN: ugit – Learn Git Internals by Building Git in Python

#4
I definitely agree that having a good understanding of git's internals is a must for using it to its full potential. I'm not sure you have to go as far as implementing it yourself, but it is a sure fire way to get there. For me it didn't all click into place until I understood the data model behind git[1]. A git project is just one big DAG of objects, and each object at its core is either a blob, a tree, or a commit. When you understand that, you can start to view every git command for what they actually are, a sequence of operations on this data structure.

[1] relevant xkcd: https://xkcd.com/1597/

Re: Show HN: ugit – Learn Git Internals by Building Git in Python

#9
Looks neat! This reminds me heavily of the excellent Building Git by James Coglan[1].

From a cursory glance though, it doesn't seem to support reading packfiles. This was the big thing that prevented me from using a fully custom Git implementation when I wrote my git churn calculator[2]. For larger repositories, it seems that almost all files are stored in packfiles, rather than the conceptually simpler "loose" format.

For me, the most valuable resource was reading the Git / libgit2 source and reference documentation.

[1] https://shop.jcoglan.com/building-git/

[2] https://github.com/samdoiron/butter

Re: Show HN: ugit – Learn Git Internals by Building Git in Python

#10

Looks neat! This reminds me heavily of the excellent Building Git by James Coglan[1]. From a cursory glance though, it doesn't seem to support reading packfiles. This was the big thing that prevented me from using a fully custom Git implementation when I wrote my git churn calculator[2]. For larger repositories, it seems that almost all files are stored in packfiles, rather than the conceptually simpler "loose" forma…

Thanks! Note that ugit isn't supposed to be a custom compatible Git implementation, but rather a simplified Git-like implementation for teaching Git concepts. So even if ugit supported packfiles, it still won't be able to read a real Git repo.
Post reply on HN