Clarity of git source codes, mercury, bazaar databases

I would like to read the source code of one of the popular version control tools to find out how version control works. I would like to read the one that is most readable.

I do not know an objective quantitative measure of this, therefore, in the spirit of WTFs / min comic , I would like to ask those who read the source codes of these tools, how much WTF / min do you evaluate for each project?

+5
source share
5 answers

If you read C well (and some Perl and bash too), adymitruk is right. Git is a good choice.

However, if you're comfortable with Python, read the Mercurial source. Many of WTF / min are going to come from your familiarity with the language and style that DVCS records. Git is written in C, Perl and the Bourne shell, Mercurial is Python (with a little C IIRC), and Bzr is written in Python, Pyrex, and C.

You will also want to consider what your tool of choice is. If you use Git, you will understand what each file implements. Similarly with Mercurial or Bzr.

Basically, when choosing which tool or language to use (or learn), a good axiom is this: go with what you know. You are trying to learn how to implement DVCS, and not how to use a specific system or language :)

+5
source

What could be much better than Python in the context of clear and beautiful code?

Go for Mercurial. I did it and it is absolutely perfect :)

+4
source

Git is your best option because it is layered. Teams are based on lower level teams. This will allow you to understand what I will do conceptually. You can execute commands yourself from lower levels. Finally, implement low-level ones to manipulate the files themselves.

Git has been designed with a lot of thought embedded in it and will give you the best learning path.

Also, take a look at Scott Chacon’s messages git internal messages and screenshots.

+2
source

Before diving into code, it is useful to first get an overview of the architecture to know where to dive. For the bazaar, this can help: http://doc.bazaar.canonical.com/bzr.2.3/en/user-guide/core_concepts.html http://doc.bazaar.canonical.com/bzr.2.3/developers/overview .html

I found the bazaar code base well organized, clean, and readable, probably because it is python, and every change to the code is checked so the documentation for the code usually changes according to the overview, which generally makes things a lot clearer. If you're stuck, you can always ask for an IRC or mailing list, but I didn't have to do so much.

+1
source

I wonder how much it costs to look for bad examples in order to understand what not to do, and not just look at good examples. I have never looked at the source of Subversion or CVS, but it might be worth looking at them and understanding why they do not work, as well as the DVCS you mentioned.

0
source

All Articles