Tor, the free and open source software for anonymous web communications, has been using the Git revision control system for more than six years. The tool is so ingrained in the project’s development that Director and Chief Architect Nick Mathewson’s daily work flow is built around Git, he says.
“Git’s the eighth version control system I’ve had to use, and the first one I’ve seriously trusted,” Mathewson said. “Many thanks to the Git developers for all their hard work.”
In celebration of Git’s 10-year anniversary this week, Mathewson shared why the Tor Project uses Git, their Git success stories, and his pro tips for using the tool. For more in our “Git Week” series, see our interviews, below, with Git creator Linus Torvalds, and project maintainers from KVM, Qt, and Drupal, with more to come tomorrow.
Linux.com: Why does Tor use Git?
Nick Mathewson: We switched to Git from SVN in 2009 because we wanted offline development, distributed development, and merging to work. We need to manage a few stable and unstable releases simultaneously, and we frequently apply feature patches that require multiple revisions and long, complex branches. For both of these cases, having robust support for merging was valuable.
We picked Git over the other options because it seemed to be gaining the most mindshare among developers. That still seems to be the case.
What makes Git such a great tool?
It’s obviously designed by programmers who made it to use it themselves, and who understand that even in the sleekest version control system, you often need to get under the hood and access raw internals.
How many developers do you have collaborating on Git?
Our git repositories contain commits from hundreds of developers. (See gitweb.torproject.org for more information.)
How much do you personally use it?
I use Git every day; my workflow is built around it.
What’s Tor’s most active Git repo right now and why?
For group projects, I’d guess that would be either the repository for the Tor program itself, or the repository for the Tor Browser, mainly because those have the most developers.
What is your favorite pro tip for using git?
I’ve attached a script I use to squash git commits without rebasing them. This makes the squash commits happen, but prevents (most) rebase conflicts.
And here is my favorite non-pro tip for Git:
alias such=git alias very=git alias wow=’git status’ $ wow $ such commit $ very push
— Chris Martin (@chris__martin) January 8, 2014
Any git success stories you can share?
A little while ago, I needed to decide what parts of Tor we should prioritize testing on. I guessed that functions which change frequently over time, and which get changed by many people, are likelier to have bugs than ones which didn’t. So I wrote a little python script to parse git blame and git log -p output, and had a full analysis of our change frequency by function since 2002.
On a more prosaic note, my sister lives out in the woods and has no reliable internet connection. Git enables me to get work done when I’m visiting here, which was nigh-impossible back before we had offline operation.
Anything else you’d like to say to mark the 10-year anniversary?
Git’s the eighth version control system I’ve had to use, and the first one I’ve seriously trusted. Many thanks to the Git developers for all their hard work.
Read more Git Week profiles: