git commit -m "Version control and me"
how I learned to stop worrying and trust git commit

In the beginning...

There was the source. The master copy of the master program, the omniscient stack of ones and zeroes that flitted across arrays of wires and gates. It effortlessly found space in the heap, and provisioned stacks if necessary. What language was its original dialect? It didn't matter. It just functioned.

And just as there was Adam, there was the Systems Engineer. The Holy Programmer Analyst III that held impressive certifications and had trekked to the high summit of Big Iron to bend the mainframe to his or her will.

Well, not really. Software has always been built by, with, around, and under teams of people. Whether that means two or four, most serious efforts that go somewhere are like the Beatles: If it was just John, then they wouldn't be the Beatles.

In order to facilitate orderly delivery of work product, different systems and schemes have made their mark on the industry. Waterfall, Six Sigma, ISO-WHOCARES, CRC Cards, Microsoft Project, and so forth. A veritable rogue's gallery of tools and methods that have had some imprint on the way we plan and execute things. One thing, one type of tool, above ALL by many miles, has endured: Source control and versioning. For those of you that don't know what I'm talking about, this brief paragraph does a pretty decent job of explaining.

I'm not going to go into the history of the subject but I've been around long enough to have endured Microsoft Visual Source Safe, which was only terrible in hindsight after I'd used a better product. Over the years, I've used BitBucket with Git, git locally, Subversion, and (mostly) Git and GitHub. I have my preferences, but I try to be less dogmatic in my old age.

I recently was part of a discussion at work that made me think about the importance of using Git properly. Why do we do it? Why is it that I just KNOW by instinct that badly implemented source control habits are worse than none at all? Nobody told me that, I just know it like I know my eye color.

It also made me think of the many vainglorious efforts I've been part of (or spearheaded) to herd engineers into a proper set of practices when collaborating, specifically in the way source control is implemented. Why sometimes it succeeded, sometimes it fails, and what the happy middle is. A few things came to mind:

So What is the Happy Path to Blissful Commits?

Keep things ridiculously straightforward and don't overburden yourself with fancy tools. My biggest recommendation is that you automate as much of this as possible. If developers use disparate tools, make sure you know what plugins or extensions they need to grab. Create scripts, leverage the IDE's ability to extend itself, and just make it easy on everyone. PR templates are nice, but don't overburden people with paperwork.

Let's try a hypothetical. We have Team One, which consists of three developers: Anne, Brian and Charlie. This team is managed by Donna. They are in the middle of a big feature push, and a sprint has just kicked off. Each person has been assigned stories that have an equitable total point value.

Near the end of the sprint, there has been some pushback on Feature 1.1. This is currently assigned to Anne, but she has her hands full and has delivered the original story per the requirements. Brian's work is winding down, and although it looks like this feature will extend into next sprint, he's willing to take on the new functionality. Teamwork makes the dream work, right? Yeah, you can strangle me later..

While Brian is working on this new piece for Feature 1.1, it comes to light that there was a missing edge case that is more of a "non-zero chance of catastrophic failure" case. Anne quickly gets to work to cover it. Now, since they are both technically working on the same feature with the same codebase, how would this work? Branches.Anne could opt to spawn off of the feature branch as a hotfix and merge when she's done. Git should handle the merge, and whether or not Brian is done doesn't matter. Even if the merge is manual, it shouldn't be too tough.

"So what?", you might ask. "I see plenty of chore work in there."

Let's remove Git from the equation.

Now everything is done via email? Or is it FTP? Or do we copy from production? Now Anne is unsure which local copy of the source she should give Brian. not that one, she was experimenting with a new approach. He might think she's nuts. Is it this one? Maybe. Then, when Brian is done and she's not, which one should she merge his work into? This is all done by hand, of course, and nobody EVER fat fingers a copy/paste operation.

I know all of this is horrifyingly obvious stuff, but it bears repetition because I have seen a trend that indicates that developers are sliding back into bad habits. Much of that comes down to a simple skill gap that can be fixed with training, or better yet, mentorship from awesome people like YOU.

  1. Pull
  2. Work the story
    1. If using static analysis, address any issues the tool finds
  3. Commit your changes
  4. Push
  5. Create a PR for review
  6. Herein lies the review loop: absorb, fix, submit for rereview
  7. Some authority (or maybe even you) merges to main/master
  8. Just for tidiness, ditch that old branch. You can always recover it if disaster strikes.
  9. Tell your project manager the good news, rejoice, drink punch, whatever blows your hair back

Please...check out this essay on software projects. It is truly priceless, and I re-read it once a year just to keep myself grounded.

Love and Happiness,
Justin

Ovalhead : Justin Stroud : The views expressed here are my own

This site is hosted by RackNerd on Alma Linux
Pages served by a Node.js process and dirt simple Express/Moustache

Ovalhead : Justin Stroud : The views expressed here are my own

This site is hosted by RackNerd on Alma Linux
Pages served by a dirt simple Express/Handlebars app