Front-End Toolbelt: `--allow-empty`

Published on June 1st, 2017

Front-End Toolbelt: `--allow-empty` image

Recently I've been working on an automated deployment system for projects, which can do useful things like allow for super simple pushes, and makes my deployments way less susceptible to error (and to be honest less scary).

However - the tedium of the project came in the form of lots of commits. So many, that I was developing this strange half-robotic, half-smashing-keys-without-really-thinking-about-it trance; I was becoming a commit robot who could fire off a whitespace change to a file in record time. The problem: I was spending a lot of time committing, and not a ton of time actually writing code. Plus the content of my robo-commits were gross and sloppy, and terribly prone to error.

Fortunately I stumbled on the --allow-empty flag, which allows you to commit something like:

$ git commit --allow-empty -m "Bump for deploy script testing"

Now with the three line succession of:

$ git commit --allow-empty -m "Bump for deploy script testing"
$ git push origin
$ git push prod master

Each bump, push, and deploy is now a mater of tapping through the last three lines of terminal history.

Your commit history is (hopefully) cleaner, you're happier, the air smells fresher, food tastes better, and maybe you're going to get yourself that haircut.

Headshot of Mike Zarandona

Huge nerd, hobby collector, happy husband & dad. The personal website of Mike Zarandona.

ProTip: A PHP Cache Buster for CSS + JavaScript Assets
2021: In Review of Music

© 2024 Mike Zarandona