Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 14, 2009
  1. @harding
  2. @harding
  3. @harding

    Added Exclusion Syntax by Jacobo de Vera

    harding authored
    -keyword or -"key phrase" should exclude those terms from the output.
Commits on Mar 13, 2009
  1. @harding
  2. @harding

    Fixed Windows Regression, New _list Function

    harding authored
    Commit f55f5e8 introduced a known regression on Windows that
    prevented users from using configuration files starting with C:\.  The
    following logic fixes this:
        +    ## If the file starts with a "/" use absolute path. Otherwise,
        +    ## try to find it in either $TODO_DIR or using a relative path
        +    if [ "${1:0:1}" == / ]
        +    then
        +        ## Absolute path
        +        src="$FILE"
        +    elif [ -f "$TODO_DIR/$FILE" ]
        +    then
        +        ## Path relative to todo.sh directory
        +        src="$TODO_DIR/$1"
        +    elif [ -f "$FILE" ]
        +    then
        +       ## Path relative to current working directory
        +       src="$FILE"
        +    else
        +        echo "TODO: File $FILE does not exist."
        +       exit 1
        +    fi
    
    New _list function takes a filename and a list of search expressions.
    We no longer use exec to call ourselves recursively.
  3. @harding
  4. @harding

    Replaced Grep Loop, Fixed Sed Bug, Some Small Changes

    harding authored
    Implemented several suggestions by Jacobo de Vera:
    
        > 1. [lines 539-551]: [...] replace the for loop with simply this:
        >    PADDING=${#LINES}
    
        > 2. [line 558]: As the script now supports a 6 digit number of tasks,
        > the first substitution should add 5 spaces instead of 2
    
        > 3. [lines 606-613]: The first search item is processed before the for
        >    loop, and the loop does the same for the rest. Wouldn't making this
        >    more general make the code more readable?
    
    The changes for suggestion #3 let me add a new feature: when VERBOSE is
    enabled, the summary line prints more info -- and it prints it on every
    run:
    
        $ todo.sh ls "buy a"
        34 Buy a portable gas can @errands +safe
        --
        TODO: 1 of 49 tasks shown from /home/harding/var/git/todo/todo.txt
    
    Also, generalizing and centralizing the code added a small but
    measurable speed increase.
    
    No new known regressions were introduced.
Commits on Mar 12, 2009
  1. @harding

    Make ls-Family Actions Use Listfile Backend

    harding authored
    Essentially,
    
        ls)
    	shift
    	exec "$TODO_SH" listfile "$TODO_FILE" "$@"
    	;;
        lsa)
    	shift
    	cat "$TODO_FILE" "$DONE_FILE" > "$TMP_FILE"
    	exec $TODO_SH listfile "$TMP_FILE" "$@"
    	;;
        lsp)
    	shift ## was "listpri"
    	shift ## was priority
    	exec $TODO_SH listfile "$TODO_FILE" "$pri" "$@"
    	;;;
    
    Also adds the following features:
    
        1. Numbers are padded with up to five zeros (but only the minimum
           necessary), letting you list up to 999,999 tasks with the same
           formatting.
    
        2. All ls-family commands hide context, priority, and project when
           the user sets those hide options.
    
        3. Quoted arguments are passed on to grep as whole arguments,
           enabling the following:
    
    	$ todo.sh ls buy a | head -n2
    	34 Buy a portable gas can
    	22 Buy door
    
    	$ todo.sh ls "buy a"
    	34 Buy a portable gas can
    
        4. listfile can take an absolute path. Any filename starting with a
           "/" will be treated as an absolute path; any other filename will
           be treated as relative to $TODO_DIR. Since a leading "/" would be
           striped by the operating system anyway under the old code, this
           is fully backward compatible.
    
    Contains the following regressions:
    
        1. The ls verbose line count messages are more generic.
    
        2. There is no verbose line count line for lspri.
    
        3. I don't think listfile's absolute path feature will work on
           Windows. If it doesn't, either this patch needs to be thrown
           away, listall needs to be rewritten, or (my preference) $TMP_FILE
           needs to set as relative to $TODO_DIR.
  2. @harding

    Modularized Listing Sed

    harding authored
    Still more to do tomorrow.
Commits on Mar 11, 2009
  1. @harding

    Revert "Set ls As the Default Action"

    harding authored
    This reverts commit 87959a8.
  2. @harding

    Set ls As the Default Action

    harding authored
    .
    Suggested by mbrubeck
Commits on Mar 9, 2009
  1. @harding
  2. @harding

    Override Overrides Using "command"

    harding authored
    New action, "command", forces todo.sh to use builtins and ignore any
    .todo.actions.d scripts.  For example, if there is an executable
    .todo.actions.d/ls:
    
        ## Run .todo.actions.d/ls
        todo.sh ls
    
        ## Run builtin todo.sh ls
        todo.sh command ls
    
    This mimicks bash's behaviour:
    
        ## Use the default echo
        harding@ziggy:~$ echo 'foo\nbar'
        foo\nbar
    
        ## Alias the echo command to "echo -e"
        harding@ziggy:~$ alias echo='echo -e'
        harding@ziggy:~$ echo 'foo\nbar'
        foo
        bar
    
        ## Force bash to call the default echo command
        harding@ziggy:~$ command echo 'foo\nbar'
        foo\nbar
  3. @harding

    Merge branch 'gina/master'

    harding authored
    Conflicts:
    
    	todo.sh
  4. @harding

    Merge branch 'gina/master'

    harding authored
    Conflicts:
    
    	todo.sh
Commits on Mar 8, 2009
  1. @harding

    Merged In Gina's Latest

    harding authored
  2. @harding

    Exit If .todo.actions.d Script Is Run

    harding authored
    .
    Suggested by Philippe Teuwen, this patch undoes a lot of the unnecessary
    formating changes in my previous patch.
  3. @harding

    Removed Extended Regexes from Hiding Code

    harding authored
    .
    Dave Hein noticed the extended regular expressions (regex) in the
    original patch don't work by default on Mac OS X (FreeBSD sed).  Now
    using his suggested regex format: [[:space:]]@[^[:space:]]\{1,\}
    .
    Also changed: I misapplied part of the patch originally.  That's now
    fixed.  I expanded part of the regular expression in the list
    sub-expression so that I could change part of the coloring code.
Commits on Mar 7, 2009
  1. @harding

    Run .todo.actions.d Before Builtins

    harding authored
    .
    Let users override default commands by creating a script in
    ~/.todo.actions.d/ with the same name as a default command.  Idea by Don
    Harper and David A. Harding; patch by Harding.
    .
    The patch adds the following logic and increases the indent level for
    the case statement:
    .
    +if [ -d "$HOME/.todo.actions.d" -a -x "$HOME/.todo.actions.d/$action" ]
    +then
    +    CFG_FILE="$CFG_FILE" "$HOME/.todo.actions.d/$action" "$@"
    +else
    +    case $action in
  2. @harding

    Hiding Priority, Context, and Project

    harding authored
    .
    Adds three new switches that hide priorty, context, and project text in
    list output.
    .
    Changes proposed by Dave Hein.  Original patch by Dave Hein.  Revised
    patch by David A. Harding. Thread starts at
    http://tech.groups.yahoo.com/group/todotxt/message/1848
Something went wrong with that request. Please try again.