project's todo with hiveminder

polettix on 2007-03-29T13:52:39

Using Hiveminder's command line interface (described here), I put together this simple wrapper shell script:

#!/bin/bash
if [ -z "$1" ] ; then
   todo.pl --tag project-name list
else
   todo.pl --tag project-name "$@"
fi
that I install in the "bin" directory of my new projects. In this way, I'm able to track to-dos via this simple interface within the project ("project-name" above in the script is "rubrica" in the example below):
# List, by default
pinco@pallo /path/to/rubrica$ bin/todo
1H27 aggiungere le foto nella lista globale [rubrica]
1H35 verificare gli errori nella gestione delle pagine [rubrica]

# Todo set to "done"
pinco@pallo /path/to/rubrica$ bin/todo done 1h27
Finished task

# Task addition
pinco@pallo /path/to/rubrica$ bin/todo add 'verificare ordinamento per cognome'
Created task

# List (updated)
pinco@pallo /path/to/rubrica$ bin/todo
1H35 verificare gli errori nella gestione delle pagine [rubrica]
1KH7 verificare ordinamento per cognome [rubrica]
Update: I also added a little function into my .bashrc to automatically call the bin/todo script if available, or to call todo.pl if not.
function todo () {
    if [ -e 'bin/todo' ]; then
        bin/todo "$@";
    else
        todo.pl "$@";
    fi
}

In this way, when I'm inside the directory of one of my projects that have a bin/todo, this is what gets called. Otherwise, it is a simple proxy for the straight todo.pl script.

Update: I ended up getting rid of the script and adding a simple .todo-tags file where I need it. I also substitued the shell function with the following script:

#!/bin/bash

if [ -e '.todo-tags' ] ; then
   taglist=$(cat .todo-tags | sed 's/^/--tag /')
fi
echo todo.pl $taglist "$@"
todo.pl $taglist "$@"
In the .todo-tags all tags are on different lines and cannot have spaces, of course, but this works for me 100% of times.


cool...

domm on 2007-03-29T21:19:22

I wasn't aware of the hiveminder command line interface.

And your added hack is also nifty.

I guess this beats stuffing various todo.txts in various repos.

Re:cool...

jesse on 2007-03-31T03:57:54

My favorite hack is this:

#!/bin/sh todo.pl --tag action download ; vim tasks.txt ; todo.pl upload tasks.txt exec $0

Re:cool...

jesse on 2007-03-31T03:58:24

Oops

#!/bin/sh
todo.pl --tag action download ; vim tasks.txt ; todo.pl upload tasks.txt
exec $0

Re:cool...

domm on 2007-03-31T09:14:14

Any reason why this nifty tool isn't packed up in a dist and available from CPAN?

The first time I run it it died because some dependencies weren't installed - if it was a proper CPAN dist, CPAN(PLUS).pm would have resolved them.

Re:cool...

polettix on 2007-03-31T09:20:26

Probably because I just woke up, but I don't get the

exec $0
part. Doesn't it enter in infinite loop? Probably yes, to keep the todo-list always available (locally) and up to date (remotely), but then I wonder how to break the loop in an easy way!