← Back to context

Comment by euroderf

1 day ago

Yes. It's funny how this kind of trick can instantly snap the entire working context back into your mind. Essentially leaving you free to forget about the context during your free time and overnight. Truly a useful "hack".

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.

Also just chuck Todo comments in the code

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.

  • > The magic of Git means you can immediately find them in the working index

    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?

    • To get your bearings regarding where you got to with your uncommitted work, you might do something like:

          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 TODO

    • Grep works too. I just spend a lot of time in git or tools that wrap it. It's an unconscious habit to check the status and diffs when I open my editor.

      2 replies →

  • If you do this often enough you can create a simple commit hook that searches for these markers and will fail to commit if it finds them.