Permalink
Commits on Aug 7, 2011
  1. split the override variables from the main file, and added a nontrival

    function or two to the version.fn
    committed Aug 7, 2011
Commits on Jul 27, 2011
Commits on Jul 9, 2011
  1. @inkarkat @ginatrapani

    Add test to enforce use of $(...) code style in todo.sh.

    Pull request #26 by trajano (e24777f) changed `...` to $(...), but the following commit 7900ad7 already added another old-style one. I think the tests can also be used for some simple enforcement of coding style, so here is a first shot at it.
    
    Closes #46
    inkarkat committed with ginatrapani Jul 9, 2011
  2. @inkarkat @ginatrapani

    depri: Check for unprioritized task and print message.

    The existing check didn't do much good, and one could deprioritize any normal task without notice. Instead, check that the task to be deprioritized actually has a priority and alert via "TODO: 42 is not prioritized." if that is not the case.
    inkarkat committed with ginatrapani May 10, 2011
  3. @inkarkat @ginatrapani
  4. @inkarkat @ginatrapani

    pri: Check for existing priority and adapt message.

    The existing check (as with depri) didn't do much good. Instead, fetch the existing priority and use that information to print more specific messages:
    - TODO: 42 re-prioritized from (C) to (A)
    - TODO: 42 already prioritized (A)
    inkarkat committed with ginatrapani May 10, 2011
  5. @inkarkat @ginatrapani

    Consistency: Use /(.)/ as generic pattern for priority in replaceOrPr…

    …epend().
    
    Even though Gina's todo.txt syntax reference only mentions uppercase A-Z priorities, this is handled in two different ways in the code. I think the following guideline is useful: For a user-supplied priority (in the listpri and pri commands), use a strict check for A-Z. In general list and edit operations that need to be aware of the optional priority at the beginning of a task, use the general /^(.) / regexp. This allows addons to use different priority-like markers (e.g. "(-) no do"), have them ignored as priorities, but still maintained by replacements.
    inkarkat committed with ginatrapani May 10, 2011
  6. @inkarkat @ginatrapani

    BUG: listpri picked up non-priority patterns.

    The regexp for the priority wasn't anchored to the beginning of the task. (As the filtering is done inside the _list pipeline, the task number has already been prepended.)
    Also, by passing the regexp directly to _list, a case-insensitive search was performed, so despite [A-Z], lowercase characters were picked up, too. Need to make use of post_filter_command to inject a separate, case-sensitive grep into the pipeline.
    
    Bonus: Added test for highlighting of listpri command.
    inkarkat committed with ginatrapani May 10, 2011
  7. @inkarkat @ginatrapani

    ENH: Allow listpri filtering via TERM.

    This even simplified the argument handling, since there can be no invalid priority any more; all other strings are taken as TERMs. And the check for empty ${1:-} was superfluous, anyway. Apart from these simplifications, it's basically just passing $@ to _list.
    inkarkat committed with ginatrapani May 10, 2011
Commits on Jul 8, 2011
  1. @inkarkat @ginatrapani

    Simplified check for done task.

    Use simple comparison with slice of string (already used e.g. in _list()) instead of grep -c pipeline.
    
    Closes #42
    inkarkat committed with ginatrapani May 12, 2011
  2. @inkarkat @ginatrapani

    Perform cleaninput() filtering without tr.

    Again, Bash's global pattern substitution can be used. This only depends on the "extquote" shell option, which is set by default, but we set this just to be sure.
    inkarkat committed with ginatrapani May 31, 2011
  3. @inkarkat @ginatrapani

    BUG: Multiple whitespace was condensed, CR/LF not turned to space.

    Missing quoting inside cleaninput() condensed multiple subsequent spaces into a single space, even when the user took pains to preserve whitespace by properly quoting the task in the shell.
    The 'tr' command completely removed CR and LF characters instead of replacing them with a single space.
    Add test cases for the whitespace handling to the add, append, prepend and replace actions.
    inkarkat committed with ginatrapani May 31, 2011
  4. @inkarkat @ginatrapani

    Expose cleaninput() for use in addons.

    Despite its hard-coded use of $input, this can be useful in addons, too.
    (I, for example, use this in a "todo.sh subst" addon that delegates to the "todo.sh replace" action after performing a sed-style replacement on the passed pattern and replacement.)
    inkarkat committed with ginatrapani May 31, 2011
  5. @inkarkat @ginatrapani

    Perform cleaninput() escaping without sed.

    No need for invoking sed; Bash's global pattern substitution can be used.
    inkarkat committed with ginatrapani May 31, 2011
  6. @inkarkat @ginatrapani

    Escape the substitution separator in cleaninput().

    Improving on the previous fix and commit, no search for an unused substitution separator is actually needed; sed supports escaping of the substitution separator. Revert the $inputSep abstraction in favor of the former, hard-coded "|" character.
    inkarkat committed with ginatrapani May 31, 2011
  7. @inkarkat @ginatrapani

    FIX: cleaninput() for sed-replacement needs more escaping and unique …

    …separator.
    
    Commit 8e4364f removed the deletion of the "|" character from cleaninput. That was okay for the cleaninput() use in _addto(), but not in those cases that used $input for replacement via sed.
    
    Added corresponding tests for replace, append and prepend actions similar to what was added for the add action in the above commit.
    
    To really fix the problem (and not just remove all "|" characters from the text), a separator character must be found that is not part of $input, and this must be used in the sed expression. As cleaninput() already modifies the global $input variable, another $inputSep global variable is used to pass back this information.
    
    In addition, backslashes must be escaped in $input, or replacements like \1 wreak havoc.
    inkarkat committed with ginatrapani May 11, 2011
  8. @inkarkat @ginatrapani

    Configure cleaninput() sed-escaping via argument instead of magic words.

    Encoding the actions that require the additional sed-escaping inside cleaninput() is cumbersome and error-prone. Instead, let the calling action tell cleaninput() that it wants this.
    inkarkat committed with ginatrapani May 11, 2011
  9. @inkarkat @ginatrapani

    Remove no-op passing of $input to cleaninput().

    The function actually uses and modifies the global variable directly.
    inkarkat committed with ginatrapani May 11, 2011
  10. @inkarkat @ginatrapani

    Made replace test sessions independent from each other.

    When the tests depend on the todo.txt contents from the previous sessions, errors will cascade and make it more difficult to pinpoint the problem.
    inkarkat committed with ginatrapani May 11, 2011
  11. @trws @ginatrapani

    Added sed line to allow priorities to be added on the command line wi…

    …th auto add date enabled.
    
    Inserted test for this case in the t1010-add-date.sh test case.
    trws committed with ginatrapani Mar 9, 2011
  12. @trajano @ginatrapani

    Changed backquotes to use $() instead.

    $(...) has superceded the `...` notation.  This can be found by
    searching in Google "command substitution superseded"
    
    Closes #28
    trajano committed with ginatrapani Feb 16, 2011
Commits on Feb 14, 2011
  1. @devonjones @ginatrapani

    Environment variables override config, flags override environment var…

    …iables
    
    * Added more flags to give action developers more control over commands
    that are leveraged inside their actions.
    * Writing a better message for the help screen
    devonjones committed with ginatrapani Feb 9, 2011
  2. @trajano @ginatrapani

    Added quotes to dirname call.

    This allows the todo.sh to exist in a path with spaces.
    trajano committed with ginatrapani Feb 10, 2011
  3. @guildencrantz @ginatrapani

    Change the default TODO_DIR so that it's the same as the todo.sh dir.

    This change makes todo.sh work out-of-the-box, and allows for excellent portable usage within Dropbox or on a flash drive.
    guildencrantz committed with ginatrapani Feb 1, 2011
  4. @guildencrantz @ginatrapani

    Todo.sh will now check for the config in the same directory as the sc…

    …ript--if it's not specified or found in HOME.
    
    This is really nice if todo.sh is kept in dropbox and accessed from multiple computers.
    guildencrantz committed with ginatrapani Feb 1, 2011
Commits on Feb 1, 2011
  1. @njwilson

    Fix erroneously removing pipe chars from input

    cleaninput() unintentionally deletes the '|' character from input.  This
    commit fixes it and adds test for adding tasks with a bunch of symbols.
    njwilson committed Feb 1, 2011
Commits on Jan 24, 2011
  1. @njwilson

    Fix substitution for hiding contexts/projects

    When using the -+ or -@ option to hide project or context names in list
    output, the color reset sequence was being deleted if the project/context
    was at the end of the line.
    
    For example, with the following tasks:
    
        (B) with priority, ending in a +project
        task that shouldn't be highlighted
    
    Running 'todo.sh -+ list' would hide the "+project" from the first task,
    but would also remove the color reset sequence ^[[0m at the end.  The
    color from the prioritized task would continue to the next lines.
    
    This commit fixes the problem and adds a test to verify the fix.
    njwilson committed Jan 23, 2011
Commits on Jan 20, 2011
  1. @ginatrapani

    Merge branch 'inkarkat/master'

    * inkarkat/master:
      Cosmetics: Corrected inconsistent indentation.
      Skipping 'nonexecutable action' test on Cygwin.
      Factored out generation of custom action scripts.
      Fixed test environment for escaped test output.
      MINOR: Removed unnecessary empty & reference in sed substitution.
      Avoiding todo.sh help error when .todo.actions.d contains subdirs.
      BUG: interpretation of \033 escape sequences in task
      BUG: task listing aborted on embedded \c escape sequence
      BUG: tr: extra operand `d' error caused by missing quoting
    ginatrapani committed Jan 20, 2011
  2. @inkarkat
  3. @inkarkat

    Skipping 'nonexecutable action' test on Cygwin.

    On Cygwin, clearing the executable flag may have no effect, as the Windows ACL may still grant execution rights. In this case, we skip the test instead of failing.
    inkarkat committed Jan 20, 2011
  4. @inkarkat

    Factored out generation of custom action scripts.

    - Reduced duplication via common make_action() function.
    - ENH: Adding proper shebang line to the custom action scripts.
    - Changed output of custom action to better differentiate from todo.sh output.
    inkarkat committed Jan 20, 2011
  5. @inkarkat

    Fixed test environment for escaped test output.

    - test-lib uses 'read -r' to parse the test session input literally, without interpretation of backslashes.
    - FIX: Use quoting to maintain original whitespace (tabs and multiple spaces) from the test session input (instead of condensing into a single space).
    - Using Bash instead of POSIX shell for t1340-listescapes.sh, so that the interpretation of escape sequences is not dependent on the POSIX shell being used.
    - Changed Makefile so that the shell selected by the shebang line is actually used when invoking tests, not the POSIX shell.
    - Above changes obsolete the multiple escaping of the test session data; now, the test session can actually be pasted as-is into a test script, even when it contains backslashes. (I.e. works as expected now.)
    inkarkat committed Jan 20, 2011
Commits on Jan 19, 2011
  1. @ginatrapani

    Added GPL license

    ginatrapani committed Jan 19, 2011
Commits on Dec 30, 2010
  1. @inkarkat
Commits on Oct 21, 2010
  1. @inkarkat

    Avoiding todo.sh help error when .todo.actions.d contains subdirs.

    I have placed tests for my custom todo actions in ~/.todo.actions.d/tests/; this causes a ".../.todo.actions.d/tests: is a directory" error on todo.sh help.
    Added condition for regular files to the executable check in order to exclude subdirectories.
    inkarkat committed Oct 21, 2010