8 ms·
Gitlet: Git implemented in JavaScript
- maryrosecook 12y agoI wrote a short post about how and why I made Gitlet: http://maryrosecook.com/blog/post/introducing-gitlet http://maryrosecook.com/blog/post/introducing-gitlet
- rtorr 12y agoKeep making cool stuff. Loved your little lisp project!
- 317070 12y agoI can't seem to find the rebase code? I've always wondered how that part works. Great work otherwise! I've already taken a look at the three way merger code.
- ethomson 12y agoIn a nutshell, it checks out the target and cherry-picks what had been HEAD onto it, beginning at the merge-base. https://github.com/libgit2/libgit2/blob/master/src/rebase.c https://github.com/libgit2/libgit2/blob/master/src/rebase.c may be helpful and (hopefully) readable.
- albertoleal 12y agoIt's pretty awesome of you to provide the annotated source code for Gitlet! :D
- brianwillis 12y agoThis is the most extreme example of Atwood's law that I've seen so far of. Any volunteers for making an operating system kernel? Or has that been done already?
- bpierre 12y agoThere is also js-git [1], a complete implementation of git in JS, founded by two fundraisers [2][3]. [1] https://github.com/creationix/js-git https://github.com/creationix/js-git [2] https://www.kickstarter.com/projects/creationix/js-git https://www.kickstarter.com/projects/creationix/js-git [3] https://www.bountysource.com/teams/js-git/fundraiser https://www.bountysource.com/teams/js-git/fundraiser
- nawitus 12y agohttps://github.com/charliesome/jsos https://github.com/charliesome/jsos
- icebraining 12y agoWell, the NetBSD kernel has been ported to JS: http://blog.netbsd.org/tnf/entry/kernel_drivers_compiled_to_javascript http://blog.netbsd.org/tnf/entry/kernel_drivers_compiled_to_... It's using emscripten, not handwritten JS, though.
- agumonkey 12y agoMy favorite emscripten demo was https://blog.mozilla.org/blog/2014/03/12/mozilla-and-epic-preview-unreal-engine-4-running-in-firefox/ https://blog.mozilla.org/blog/2014/03/12/mozilla-and-epic-pr... It was really impressive to see UE4 running at ~7 fps on an old ThinkPad (without discrete GPU) in pure software.
- jcrites 12y agoDo you happen to have a link to the demo? I looked around but haven't been able to find it. It looks like the demo lived at the time at https://www.unrealengine.com/html5 https://www.unrealengine.com/html5 - and the site doesn't seem to work through Wayback Machine.
- agumonkey 12y agoI randomly clicked on an URL Brendan Eich gave on twitter. Maybe this http://kripken.github.io/misc-js-benchmarks/banana/benchmark.html http://kripken.github.io/misc-js-benchmarks/banana/benchmark... bbl
- skeoh 12y agoSome might also find js-git interesting: https://github.com/creationix/js-git https://github.com/creationix/js-git
- isxek 12y agoThanks for posting this. I remembered seeing a similar project before, but I couldn't remember the name.
- patcoll 12y agoSee also: https://github.com/creationix/js-git https://github.com/creationix/js-git Kickstarter: https://www.kickstarter.com/projects/creationix/js-git https://www.kickstarter.com/projects/creationix/js-git
- caipre 12y ago> Sometimes, I can only understand something by implementing it. So, I wrote Gitlet, my own version of Git. I pored over tutorials. I read articles about internals. I tried to understand how API commands work by reading the docs, then gave up and ran hundreds of experiments on repositories and rummaged throught the .git directory to figure out the results. When the source itself is available, why not just read the code? I understand using articles and documentation to get the high to mid level view, but why not go to the real source of truth if it's available?
- nicholasjbs 12y agoI find reading the source of things can be incredibly helpful in some cases, but when I want to really grok something, I need to write code myself. When I'm just reading code it's easy to trick myself into thinking I understand something, but it's much harder to do that if I have to make a piece of code work correctly. Peter Seibel wrote a great post on code reading, which hits on a similar point: http://www.gigamonkeys.com/code-reading/ http://www.gigamonkeys.com/code-reading/
- caipre 12y agoI was referring more to the "ran hundreds of experiments" than the "understanding by implementing." I agree wholeheartedly that actually making something reveals far more about a problem/solution than would simply reading about it.
- makmanalp 12y agoIt's just a different approach - sometimes understanding top-down is easier than bottom-up. The git code is pretty clean and simple, but pedagogically speaking it's not super easy to get an understanding of everything without reading most of it. It's like reading a math paper where they define all the variables they use first before even getting to the main ideas. It's more rigorous, but not necessarily the most straightforward way to convey something. Also, you don't necessarily always care that something is a struct or a union or that it's implemented as a custom variant of a B+tree that does xyz or that there's this quirk on Solaris that causes filenames to be written on disk backwards or something.
- Procrastes 12y agoI really liked your "Git in 600 words.[1]" I think it will help clear up some confusion for some of my VCS wary colleagues. 1. http://maryrosecook.com/blog/post/git-in-six-hundred-words http://maryrosecook.com/blog/post/git-in-six-hundred-words
- throwawaymsft 12y agoNot to be rude, but I'm baffled why a professional programmer could be "wary" of using a VCS. Or is it just git in particular? (More understandable, there's a learning curve, but nearly every major project is using it. Git's proven itself.)
- jerrysievert 12y agoi once took a leadership position at a small company that had a longtime contractor building one of their core web products out of foxpro. he refused to use any VCS, proclaiming that "version control is for the weak". needless to say, he didn't last very long.
- test1235 12y agoHe didn't last very long because he didn't agree with you? 'cos clearly whatever he was doing was acceptable up till that point.
- toolz 12y agoThere's no real opinion being given here. That would be like suggesting a general contractor on a new home was fired for difference of opinion, when the reason was he just didn't have insurance.
- throwawayaway 12y agogit checkout <branch> where did my changes go?
- 12y ago
- zyxley 12y agoIt would be interesting to see this baked into a browser-based text editor. Make it fully client side and you can potentially save the git history in localstorage and use it as an offline web app. I wonder if there are any git servers that support websockets...
- teraflop 12y agoNo need for websockets. Git has supported pushing and pulling via HTTP for many years.
- azeirah 12y agoYou don't need git for that, simply save every keystroke made by the user.
- WickyNilliams 12y agoCan't tell if you mean overwriting after every keystroke (if so, no history); or saving a "fresh copy" after each keystroke (history, but terribly inefficient - localStorage has space limitations); or saving a series of diffs (how far do you have to go down that path before you realise you should have just used git?)
- Sir_Cmpwn 12y agoI've asked GitHub to enable CORS for their https git endpoints, and I'm not the first. Email them at support@github.com if you can think of some cool stuff to do with that enabled.
- filearts 12y agoThis is a collossal effort and a huge community service. Thank you for being so thorough in documenting your work. Even if others don't directly use your code, you have given the world a great template to understand and implement git!
- hyp0 12y agoA related way to learn is from git's initial source, which was quite small. https://news.ycombinator.com/item?id=8650483 https://news.ycombinator.com/item?id=8650483 Warning: the file format has changed slightly.
- jokoon 12y agohow are files handled ?
- joelthelion 12y agoWhat are the expected use cases?
- nhlx2 12y agoWhy JavaScript?
- robotnoises 12y agoAtwood's law?
- phatak-dev 12y agoSuperb effort.
- stevekim 12y agoIts a great project to start with
- gitspirit 12y agogit is a tool that have to be introduced to as many as possible, even non-developers. In essence git is a fundamental part of the future global world collaboration. One can't overestimate the gits value.
- zrail 12y agoOT: I love the typography on your site, especially the little touches like the decenders overlapping link underlines. edit: after some research turns out the link underline styling is a Safari thing. My point stands, though, the typography is wonderful.