DevOps

The dark side of Git

Git is Great!

As a distributed source code tool, git is great. I love that when I’m on an airplane I can commit code without a wireless connection and have be able to unwind what I was doing. It was clearly designed with the “offline” model in mind. The idea I can create a quick branch, experiment, make massive sweeping changes, and just drop the whole thing if I realize it sucked…is AWERSOME! For a fact this puts it ahead of it’s open source predecessors (namely…SVN, CVS, and RCS).

But perhaps a victim of it’s success

What I observe, however, is that a lot of folks have taken up a development model where “everything is a branch” and we end up with roles like “pull request approval engineer” (not a real title, but if you end up doing that job, you’ll know that your doing it). This problem happens when the number of public branches/forks reaches a count and complexity that far exceed any value they could have possibly served.

What is productivity?

I’m going to take a somewhat unpopular stance here, but in general my stance is that branches are antiproductive… before everyone gets their pitchforks out, let me explain my version of “productivity” for a software project. Productivity is producing software that accomplishes the business purpose at a marginal cost that provides positive value. While that might have been wordy or even technically incorrect, the overall equality formula I wan to use is: sum of all activities to product the software must be less than the value the software provides. In other words, if it costs 2 million dollars to build/deploy some software, but the business can only recoup 1 million dollars in value (via cost saving or new sales or whatever) the I would consider that a failure.

The branching use case

As a software engineer, I want to create a branch so that other developers cannot see my changes in their builds.

Well that sucks because:

  1. First of all, the activity of creating the branch, merging in everyone else’s branch to your branch (through possibly a different branch) is all stuff that you would get instantaneously for free if you were all working on the same mainline.
  2. Second, you’re deliberately delaying visibility of changes from the rest of the team…which means the whole notion of continuous integration is getting thrown out the window

Which brings me to a key question

Are you operating with agility or fragility?

I would contend if you’re branching for every feature or bug and merging them back in, your codebase and/or process is more fragile than agile.

Your Thoughts?

Published on Java Code Geeks with permission by Mike Mainguy, partner at our JCG program. See the original article here: The dark side of git…

Opinions expressed by Java Code Geeks contributors are their own.

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scott Stanchfield
4 years ago

Take a look at gitflow. It solves this via common branches that are used for “current development”, “current release”, etc. You could have additional “integration” branches that work to group individual changes together. This allows each change to be made (and completed) without interference from others, and, more importantly, if in the middle of some other change, that other change is pushed back to the backburner or abandoned, you don’t need to “undo” anything; you just don’t merge _in_ that other change. I totally get what you’re saying about pull-request approval feeling like a full-time job. (I often feel like… Read more »

Matthias Sohn
Matthias Sohn
4 years ago

Use Gerrit Code Review which manages review branches automatically and provides a nice code review workflow
https://www.gerritcodereview.com/

Back to top button