DECODING LEGACY
A JOURNEY THROUGH COMMIT MESSAGES
AIRTON ZANON
This talk is not about
Atomic Commits
This talk won’t teach you
advanced GIT tricks
Today we gonna talk about
Commit Messages
and their consequences on the
history of your software
Airton Zanon
Tech Lead at Temper
Having trouble to understand why a
change was done for 9 years
airton.dev
@airtonzanon@phpc.social
git status
git add
git commit
git pull
git push
git log
git checkout
git switch
What I thought version control was for…
But actually …
Why do we use version control?
Reference: https://about.gitlab.com/topics/version-control/#why-use-version-control
Why do I need to add a
description? Isn’t this clear
enough?
WTF took to months to the next commit?? 🤯
?
Today I see that I didn’t leave a good legacy for that
company
Joining a new Company
- Commit Review Culture
Gerrit
git status
git add
git commit
git pull
git push
git log
git checkout
git switch
git blame
git rebase
git merge
Culture
- Commit messages should answer:
- What was changed?
- What problem this commit solves?
- Why are we changing this piece of code?
- Complete the sentence “If applied, this
commit will …”
- Should be reviewed just as
another piece of code
{ WHAT }
{ WHY }
git status
git add
git commit
git pull
git push
git log
git checkout
git switch
git blame
git rebase
git merge
git add -p
git commit --fixup
git amend
git rebase -i
git push --force-with-lease
git bisect
Your software tells a
Story
- What is the legacy of your work? A story that you and others can understand?
or …
- No one thinks it will be important until it
happens to be
- No one thinks it will be important until it
happens to be
- We always say that we will write
documentations, but …
But we can actively keep track of the
changes
Learning the context brings empathy
Empathy
But it’s too much!
Start Simple
- There's no strict definition of the ideal
commit message
- Indicate a logical change, a new feature,
fixing a specific bug
- If you can’t describe the change, split in
smaller ones
Conventional Commits
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
https://www.conventionalcommits.org/en/v1.0.0/
The commitizen command line utility
https://github.com/commitizen/cz-cli
Resistance!
Self Documented Code Fallacy
Legacy Code
The
Broken Window
Theory
Any fool can write code that a computer can
understand. Good programmers write code
that humans can understand.
- Martin Fowler
Any fool can use a version control. Good
programmers try to help people in the future
to understand the current context.
- Me?!
Next time, take 2 or 3 minutes with your
commit message,
you might thank yourself in the future
Thank you!
Questions!?
airton.dev
@airtonzanon@phpc.social
https://joind.in/talk/f5023

DECODING LEGACY: A JOURNEY THROUGH COMMIT MESSAGES