Puppet's dozens of Git repositories see new code commits every day from more than 200 people, says Michael Stahnke, director of engineering services at Puppet Labs. And he personally uses the open source revision control system several times a day.
“I can’t think of another tool that changed the way I work, in a positive way, more than git,” Stahnke said.
In this Q&A celebrating Git's 10-year anniversary this week, Stahnke shared why Puppet Labs uses Git, their Git success stories, and his top pro tip 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, Drupal, and Tor.
Linux.com: Why does Puppet use Git?
Michael Stahnke: We have about 150 people in engineering and another 70-100 in roles where slinging code is certainly an expectation of the job. When you have people working around the world, you need a DVCS. When you need a DVCS, you use git. Puppet (the project) moved to git in 2007, when it was just a single developer doing nearly all the coding. But the tools git provides, such as the ability to commit work on an airplane, were immediately of use.
What makes Git such a great tool?
First, cheap merges. They usually advertise cheap branching as a thing you want. I actually want cheap merges, because that’s where the trouble lies. Beyond that, it’s flexibility. We’ve done mailing list patches, we’ve used pull requests, we’ve done merges with rerere. Rebasing to make commits and branches have a clean history with messages that make sense is hugely helpful for experiments.
How many developers do you have collaborating on Git?
I think we have about 230 people using our git repos on a regular basis. We have just north of 1,000 repos in our organization on github. We manage everything from our software, to documentation to educational materials using git.
How much do you personally use it?
Personally, I use git several times a day. I’d guess I make somewhere between 2 and 20 commits a day on average (and I’m a manager).
What's Puppet's most active git repo right now and why?
I’m not sure what the best metric is to use for activity, but we have dozens (probably around 100) repos that basically see commits daily. Puppet is very active, as is beaker our testing framework, puppet-server, PuppetDB and lots of Puppet modules.
What is your favorite pro tip for using Git?
Version your projects using `git describe`. If you use tags, you can use ‘git describe’ to version things when doing scratch builds. We do this on nearly all of our projects in our build pipelines. It takes the guess work out of the build process and unlike just using a raw sha, it sorts properly.
Any Git success stories you can share?
When you have meaningful commit messages, everybody’s life is better. Often you can figure what was changed from the diff, but why it was changed is what’s needed in the commit message. In our commit messages we look for why something changed, how did it used to work and how does it work now. We’re pretty medieval about commit messages. The person reading those messages will appreciate the effort you put into them, even if that person is future-you. We often start our release notes by reading the commit messages for the projects.
Anything else you'd like to say to mark the 10-year anniversary?
I can’t think of another tool that changed the way I work, in a positive way, more than git.
Read more Git Week profiles: