by jraph · 1y ago · 0 comments
When there are no clear tasks, I sometime leave a syntax error at the place work should continue tomorrow. This is quite effective. It can make the answer to the "Where was I?" question immediate instead of taking a few seconds and this is one fewer barrier.
It's also useful to jot down a quick list of (say) three items that are at the top of your mind when you leave work for the day, and they too will help with a context restore.
The magic of Git means you can immediately find them in the working index and get back on to it. Just remember to remove them before the commit.
How does git help you find certain texts in files? `grep` should do the trick just fine, unless I misunderstand what "chuck Todo comments in the code" mean, the code lives on your disk no?
git status && git diff HEAD
That will tell you which files you've touched and will show you their diffs. If necessary you can search within the diff: press '/' to bring up the search feature (assuming you're using the default less pager).To search for all mentions of 'TODO' in the repo, ignoring untracked files:
git grep TODO
or, case insensitive variant: git grep -i TODOGrep will find them too, but any in the diff you'll know for sure were added by you.
Introducing a syntax error is like a saved game, portal back in time. I'll come back to it tomorrow and it'll take me max one minute to reload the context into my brain.