5 ms·
DIY Git in Python
- TuringNYC 3y agoPutting aside git, i love the format and step-by-step teaching! You've done a better job at this than 99% of CS professors i've ever had. Thank you for doing this!
- evgpbfhnr 3y agoThis interface is downright awesome; I'd love something that takes a git repository and displays the commit message along with the diffs like this (might be how this works under the hood) If there's something usable like this I didn't know about, please say! EDIT: from comment in the first page the author said it's custom typescript which isn't open-source yet, there's still hope :)
- jamesdutc 3y agoSimilar (but a far more limited implementation): “Write a Git Client from Scratch in 25 Minutes” https://youtu.be/xvzo_nV9PjU https://youtu.be/xvzo_nV9PjU
- aardvarkr 3y agoThis has been posted before but it’s incredibly well written and easy to follow. I had a blast with it last time it made the front page. Great post to reshare!
- asicsp 3y agoLinks: https://news.ycombinator.com/item?id=28735425 https://news.ycombinator.com/item?id=28735425 (194 points | Oct 3, 2021 | 23 comments) https://news.ycombinator.com/item?id=24517925 https://news.ycombinator.com/item?id=24517925 (309 points | Sept 18, 2020 | 30 comments)
- tech234a 3y agoLoosely related: Dulwich, a pure-Python Git implementation https://github.com/jelmer/dulwich https://github.com/jelmer/dulwich
- microtherion 3y agoThis seems to be a similar idea to James Coglan's excellent book _Building Git_, which reimplemented Git in Ruby: https://shop.jcoglan.com/building-git/ https://shop.jcoglan.com/building-git/
- ibitto 3y agoTwo more Python implementations are mentioned in build-your-own-x [0]. - https://wyag.thb.lt https://wyag.thb.lt - https://benhoyt.com/writings/pygit/ https://benhoyt.com/writings/pygit/ [0]: https://github.com/codecrafters-io/build-your-own-x#build-your-own-git https://github.com/codecrafters-io/build-your-own-x#build-yo...
- forgotpwd16 3y agoAlso codecrafters itself has build your own git course.
- okasaki 3y agoProbably fun to read and educational, but why in the world does the page use grey text on a grey background?
- anamexis 3y agoIt passes WCAG contrast guidelines just fine. It has a contrast ratio of 7.84, and the WCAG AAA standard requires 7.0. I find it very readable.
- zserge 3y agoA similar toy git in Go (but probably smaller and more limited): https://zserge.com/posts/git/ https://zserge.com/posts/git/
- fiddlerwoaroof 3y agoI implemented a read-only implementation of git here: https://github.com/fiddlerwoaroof/cl-git https://github.com/fiddlerwoaroof/cl-git It’s nearly complete, I just have to finish a couple annoying edge cases around delta compression.
- teleforce 3y agoNice tutorial on building Git with Python from scratch. This book teach building Git from scratch with Ruby: https://shop.jcoglan.com/building-git/ https://shop.jcoglan.com/building-git/
- macintux 3y agoI really love the idea, but it's sent me down the Python packaging rabbit hole because the very first page's recommendation to use `python3 setup.py develop --user` doesn't work without some customization that I have yet to figure out. First, it seems to (maybe?) work better with a venv running, which I didn't have. Ok, I can create one. Next, `SetuptoolsDeprecationWarning: setup.py install is deprecated`, although I can live with that for now. Next, I'm provided with a long list of ideas for how to enable `.pth` files, but https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#use-the-user-option https://setuptools.pypa.io/en/latest/deprecated/easy_install... strongly implies that `export PYTHONUSERBASE=`pwd`` prior to running setup should work. It doesn't. Python, why does your ecosystem have to be so broken?
- alex_lav 3y agoPython packaging sucks. It's a big part of my job right now. To get various things to work, I've had to downgrade setuptools and manually install Cython.
- Too 3y agoThat instruction is not the recommended way. To make it work, use a virtualenv, seriously always use a virtualenv. Then inside: pip install --editable ./ This has been the standard way to install packages since forever. Don’t know why author complicates it with lower level setuptools. This is the same message that deprecationwarning is giving btw.
- macintux 3y agoThanks, that did the trick. I'm going to argue, however, that "standard" is far too strong a word. I've been using Python on a near-daily basis for the last 4 years. I've never run into that, and I don't see it at the Hitchhiker's Guide. Well, that and Python doesn't seem to do standard.
- xcdzvyn 3y agoIt's almost surprising how far Python has come with the state pip is in; it's so rare to have any remotely sizeable software's dependencies install properly without some hacking.
- wild_pointer 3y agoI took this tutorial and it vastly improved my git understanding, nicely done in both content and the way it's presented!