git yolo 🦀, safely

Dec 6, 2024

You only live once. So keep smashing 🔥 code. You don't have time to decide the commit message - so git yolo!

git yolo

💡
Use at your own risk in your $dayjob

Put this in your shell configuration file (.bashrc , .zshrc or equivalent file).

git config --global alias.yolo '!git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'

Then keep git yolo'ing and lough at the random commit messages generated for you 😂.

$ git yolo
[main 68f1d42] Too tired to write descriptive message
 1 file changed, 12 insertions(+), 12 deletions(-)
This is what this looks like!

cargo check, non-patronising

You know your 💩 well, so there is no need for those patronising error messages generated by Rust compiler. You just need to the error message, the source file and line number - all concisely. Thankfully, the Rust community have thought about this.

cargo check --all-targets --all-features --message-format short
concise error message from Rust compiler

One alias to rule them all!

The ultimate productivity hack for weekend hacking can also be safe. gycc is my alias of choice (git yolo after cargo check)

gycc

git yolo, only if it compiles

So, how is it composed? let's peel the 🧅!

$ which gycc
gycc: aliased to ccc && gyc

$ which ccc        
ccc: aliased to cargo check --all-targets --all-features --message-format short

$ which gyc 
gyc: aliased to git add --all && git yolo && git push

$ git config --global alias.yolo
!git commit -m "$(curl -s https://whatthecommit.com/index.txt)"

$ git config --global alias.yolo '!git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'

Putting it all together

Add the following in your shell config file (.bashrc , .zshrc or equivalent file), reload the shell - and enjoy gycc!

alias ccc="cargo check --all-targets --all-features --message-format short"
git config --global alias.yolo '!git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'
alias gyc='git add --all && git yolo && git push'
alias gycc='ccc && gyc'

Mohammad Mustakim Ali

I'm a Software Engineer living in London, UK. My passion is to make *very fast* software with great user experience and I have just got little better on this than I was yesterday.