Git Branch Naming

The CTO of my company recently reviewed a set of dependent PR's I submitted (here, here, and here). They had a particularly long and annoying branch name radiasoft/devops/issuue/232-raydata-initial-app**. The branch name was annoying enough that he sent an email to our software team saying: he would prefer if we use kebab-case in our names and we shouldn't include the organization name (ex radaisoft) in the branch name. His reasoning for kebab case is personal preference and the organization name is unnecessary since we rarely submit PR's outside of our organization. My feeling when someone sends and email like this is that the answer should almost always be "yes."

Issues like branch naming are the thorny issues in software where finding the right answer is nearly impossible. But, the wrong answer is to spend time thinking about it and for folks to not come to an agreement. Having a regular naming pattern that everyone agrees on allows tooling to be built around it and frees minds to think about other things that matter more. Amazon has a value of "Have backbone; Disagree and Commit" that I think that applies well in this case. Maybe by saying "yes" so quickly I didn't have a backbone. But, all of us committing to using the same strategy is what I think is important.

But, if I was the kind of person that liked to die on hills of no value then I would say I disagree.

The long name with the organization is annoying but it is only annoying once, the first time I type it in. We use GitHub and their UI has nice "copy to clipboard" buttons in most places where a branch name is displayed. In my shell I have the function gb which displays all of my local branches and lets me enter a number to select one. So, after the initial git checkout -b I never fully type out the name again.

Using organization/issue/number-description maps closely to the syntax for tagging an issue in GitHub (organization/issue#number). That means less syntax for me to remember and fewer characters to change when I copy the branch name into a commit message to tag an issue.

Using organization/issue/number-description also maps closely to URL's. It would have been nice if GitHub had chosen issues/number for tagging because then branch names would map perfectly to their URL's. But, still I only have to pluralize issue and remove the description (easy with C-k in the browser) and I can quickly navigate to the issue I'm working on.

Maybe one day when I'm in charge I'll use my strategy but for now it's kebab case with no organization name for me.

** In case you didn't catch it I misspelled issuue. I've started using flyspell in Emacs but it doesn't play nice with code. If someone has a spellchecker they use in their editor that actually works please send it to me.