最小的,玩具,分布式版本控制系统学习
我有兴趣写一个玩具 DVCS。
需要研究的最小 DVCS 是什么?
(我不需要 ssl、ssh、svn 兼容性等...它应该能够执行本地存储库)
I am interested in writing a toy DVCS.
What is the smallest DVCS around to study ?
(I don't need ssl, ssh, svn compatibility etc... it should just be able to do local repositories)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Git 的实际核心相当小。不幸的是,它不是用易于理解的编程语言编写的,并且充满了与实际操作无关的性能优化。
但是,Git 有多种替代实现,特别是用 Python 编写的 Dulwich 库。
还有 Amp,其目标是为所有主要的分布式版本控制系统提供统一的接口。目前,他们只实现了 Mercurial,但 Git、Bazaar 和 Darcs 也在计划中。现在,Mercurial 是用 Python 编写的,而 Amp 是用 Ruby 编写的,它们的表达能力相似,因此您可能会认为差异并没有那么大。然而,Amp 的设计使您可以在 Git 存储库上使用 Mercurial 命令,或者在 Mercurial 存储库上使用具有 Bazaar 语义的 Darcs 命令,因此这些层之间有非常清晰的分离。 并且 Amp 的设计使得即使非程序员也可以使用 Amp 的构建块编写自己的个性化版本控制系统,因此代码极其简单明了。
The actual core of Git is rather small. Unfortunately, it's not written in a programming language that is amenable to easy understanding, and it is riddled with performance optimizations that are not relevant to the actual operation.
However, there are several alternative implementations of Git, in particular the Dulwich library, which is written in Python.
There's also Amp, whose goal is to provide unified interfaces to all major distributed version control systems. At the moment, they only implement Mercurial, but Git, Bazaar and Darcs are planned as well. Now, Mercurial is written in Python and Amp in Ruby which are both similarly expressive, so you might think that the difference isn't that big. However, Amp is designed so that you e.g. use the Mercurial commands on a Git repository or Darcs commands with Bazaar semantics on a Mercurial repository, so there is a very clear separation between those layers. And Amp is designed so that even non-programmers can write their own personalized version control system using Amp's building blocks, so the code is extremely simple and straightforward.
git 的初始版本
有 1,064 行代码(ansic=822,sh=242)。
有关历史记录,请参阅:
最初进行提交如下所示:
The initial version of git
had 1,064 lines of code (ansic=822,sh=242).
For a chronicle, see:
Initially making a commit looked like this:
看看化石分布式版本控制,它只有 350kb。
http://www.fossil-scm.org
Have a look at fossil distributed versioning it's only 350kb.
http://www.fossil-scm.org
Darcs 是用 Haskell 编写的,但它相当大:40 KLOC。 Mercurial 也是 40 KLOC 左右,但它的核心是 20 KLOC 左右。
Darcs is written in Haskell, but it is quite large: 40 KLOC. Mercurial is about 40 KLOC too, but its core is about 20 KLOC.