[HN Gopher] Show HN: ugit - Learn Git Internals by Building Git ... ___________________________________________________________________ Show HN: ugit - Learn Git Internals by Building Git in Python Author : nikital Score : 119 points Date : 2020-09-18 15:22 UTC (7 hours ago) (HTM) web link (www.leshenko.net) (TXT) w3m dump (www.leshenko.net) | codesections wrote: | This strikes me as a cool and polished version of shit, the Git | implementation Drew DeVault did in pure POSIX shell. | https://git.sr.ht/~sircmpwn/shit | narwally wrote: | 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/ | srathi wrote: | Awesome. I did the same while learning both Golang and git, and | implemented parts of git in Golang. [0] | | [0] https://github.com/ssrathi/gogit | Conlectus wrote: | 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 | microtherion wrote: | Seconding the recommendation for "Building Git", one of the | most lucid and edifying books I've read in recent years. | nikital wrote: | 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. | SomaticPirate wrote: | Reminds me of https://codecrafters.io/challenges | numbers wrote: | Looks great! I'm wondering if there are other tutorials like this | but for Ruby? | pokstad wrote: | The defacto version was in Ruby: | | https://shop.jcoglan.com/building-git/ | ravenide wrote: | Is this tutorial interface (navigation, diffs, files/downloads at | each step) custom made? It's pretty nice for this kind of format. | travmatt wrote: | I was wondering the same, this format feels extremely intuitive | for the material it explores. Looking at the HTML and the CSS | class names I'd assume it was handmade, but it seems like | standardizing this format or even generating this webpage | format from a repo would be a useful tool. The comment left at | the end is ambiguous as to whether it refers to the tutorial or | the website as a whole. | at_a_remove wrote: | Maybe _this_ is what I need to like git. | dimator wrote: | Polished presentation! I like to learn from first principles, so | this is perfect. | | There is also write you a git: https://wyag.thb.lt/ ___________________________________________________________________ (page generated 2020-09-18 23:01 UTC)