Lessons from a Cool Engineer, Part 1: Breaking things down, section B: making commits as small as possible

Lessons from a Cool Engineer, Part 1: Breaking things down, section B: making commits as small as possible

This is a tricky one. You want commits to be as small as possible write? At work we talk a lot about atomic commits. It’s a single piece of code that is self complete and that could work by itself without anything else added into it. So I guess a simple conclusion would be to aim for the smallest possible atomic commit. Is it really as simple as that? Is there nothing else left to say? I wonder if I have been following this principle 

Now I am the biggest fan in the world of verbose commits but that is coming in a later post. So let us go back to wondering if my commits are small and yet nevertheless atomic 

A white coding themed image with text saying: “how small should your commits be?”


In the past I know I have done working commits. But I haven’t necessarily done them as self contained pieces of work. So how can I make sure that my commits are self contained pieces of work

And do I even want them to be that. I like working with small commits as I have work in progress

Should I squash them afterwards? Isn’t it ideally meant to be a PR per ticket? Should every ticket be a small commit?

Do commits HAVE to be atomic?

Comments

Popular posts from this blog

Hello World

“But yesterday, I heard God say, you were born to be the one…”

In the Water, I find Fire