Dark Light

Something I keep doing: Forgetting to commit to git.

Having pretty much moved everything over to git & github for all my source control needs, I am now getting used to how Git works. It hasn’t, however, solved the problem that I’ll occasionally work on something for a while, make it work on my local system, then forget to commit to it and return some days later to work on something else. Commits become either huge things of no trackability, or I end up committing by chunk and trying to remember exactly *why* I changed the define syntax to be “look up” instead. So, because I don’t have enough impenetrable bash scripts in my life, I wrote another one.

This one finds git repositories in $HOME, iterates though them looking for where your friendly user hasn’t committed stuff, and then whines to him in email about it.

it’s executed like this:

and the “uncommited-dir.sh” file looks like this:

4 comments
  1. I have this problem with git repositories — or revision-control in question — too: I keep forgetting to checkpoint *while I’m working*. Which means my commits become huge, and I either have to use interactive-mode to split things out into logically independent changes, or just commit things en-masse.

    Neither solution is ideal.

  2. Oh, it would also be best to use `mktemp` to create temporary files. Stops people succeeding when they attempt to do nasty things to you.

  3. I’ve updated the script to use mktemp.

    As for doing it as I go along, you could possibly integrate this with something like Workrave, which aims to prevent RSI problems by making you take breaks. If you commited whenever Workrave wanted you to take a rest break, that might work.

Leave a Reply to David Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts