What’s this about Macro-commits?

Micro-commits: The Good, the Bad and the Ugly

  • You focus on one thing at a time,
  • your workflow is stable and you rarely end up standing on a burning floor with a crumbling roof above your head,
  • you “save your game” (as the original author put it) and can fall back into your safety net (a.k.a. git reset --hard) at any time instead of having to start from scratch,
  • you are encouraged to share changes with your team early, reducing the risk of a total merge catastrophe,
  • a regular reviewer can easily follow your thought process, making reviewing quick and less of a chore,
  • rebasing small commits on top of a moving branch is easy,
  • the green bathroom tiles on your GitHub profile make you look like a super-hero.
  • You focus on only one thing at a time,
  • the larger your test suite and the longer your build times are, the less attractive it becomes to run the whole thing every few minutes,
  • if you only test changes locally and with only parts of the test suite, breakage may still occur when your changes hit the CI server,
  • if you get carried away, you start spending more time thinking about your commit messages than your actual code,
  • and if you don’t, your commit messages become meaningless and over time your whole history turns into utter rubbish that might as well be truncated,
  • an occasional reviewer wastes a lot of time following your convoluted thought processes from last week, which not even you understand anymore,
  • bisecting a longer history takes longer,
  • bisecting a longer history in which not every commit is green and atomic is a catastrophic waste of time,
  • rebasing a long tail of small commits on top of a moving branch is virtually impossible.

Where Macro-commits save your day

Macro-commits are not coding “landfill-style”

Micro-commits do not necessarily let you rebase

I do not care what you were thinking six days ago

Intermediate commits which are a gorgeous waste of time to review.
Backport PR with three logical macro-commits.

Intermediate commits which do not pass should not exist

Commit messages matter (a lot)

A helpful macro-commit message.
Another helpful macro- (or micro?) commit message.

And lastly: The changelog





Programmer, data scientist, human being, maintainer of KeePassXC

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to rewrite HTTP-Request-Paths in Quarkus

The Right Agile Foundations Will Boost Your Success

Variables! — The Building Blocks of Programing

IoT Data Pipelines in GCP, multiple ways

Decentr MVP v1.0 Release

Conway’s Game of life Coding Question

Location-based search results with DynamoDB and Geohash

Advanced clean code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Janek Bevendorff

Janek Bevendorff

Programmer, data scientist, human being, maintainer of KeePassXC

More from Medium

[DPS909] Contributing To My School’s Open-source Project

How to fix “VBoxManage: error: Code E_ACCESSDENIED” or “Error checking TLS connection”

Progress Report For The Last Assignment

Hexagonal Architecture for People in a Hurry