You can keep quick, short-lived personal TODOs as empty commits in the current git branch (original tweet):
todo() {
git commit --allow-empty -m "TODO: $*"
}
<i>You can save this either as a shell function or git-todo
executable.</i>
Use it like so from the command line:
todo Check if feature X works under edge-case
This records an empty commit prefixed with "TODO". This way git log
will remind you both what you have done on this branch and what you need to be doing:
$ git log --oneline master..
9ca4a06 TODO: Check if feature X works under edge-case
ca343b0 implemented awesometastic feature X
Obviously, these commits are only meant to be temporary and never part of the long-term project history. If you're doing your housekeeping and git rebase -i
the branch every time before you push, git notices that these TODO commits are empty and automatically comments them out from the list of commits to keep.
pick ca343b0 implemented awesometastic feature X
# 9ca4a06 TODO: Check if feature X works under edge-case
fixup 5c33289 fixed the edge case
You still get to review the TODO list, but you don't have to worry about cleaning up these commits manually.
This isn't a mechanism to store long-term TODO items or share them with the rest of your team. It's more for adding reminders to yourself for your next coding session.
Because you recommend doing this on feature branches it might be useful to only see the log since the dev branch, you can also do a grep for the word 'TODO'.