Permalink
Commits on Mar 19, 2012
  1. Ignore user data.

    todb committed Mar 19, 2012
    If you run out of git checkouts, should probably ignore the todo.txt
    data file (and friends).
Commits on Mar 1, 2012
  1. Merge pull request #80 from inkarkat/complete-enhancements

    ginatrapani committed Mar 1, 2012
    Complete enhancements
Commits on Feb 29, 2012
  1. FIX: task number completion doesn't work on OS X.

    inkarkat committed Feb 29, 2012
    The recently added tests revealed that. Because of the sed \+ bound. As in  f3fc18a, fall back to the \{1,\} basic regexp.
  2. ENH: Better completion for custom add-ons via new listaddons command.

    inkarkat committed Feb 28, 2012
    The todo_completion had the problem that it didn't consider the todo.cfg itself for the location of TODO_ACTIONS_DIR, it just tried the default location or a globally exported config value. With the injection of custom configuration now in place, we can actually delegate the listing to todo.sh itself.
    The added built-in "listaddons" command is used for that; it may also be helpful for troubleshooting or to find out about available add-ons. (But the help / shorthelp commands offer more information.)
    
    Additionally, completion is now more precise; only executable actions and no subdirs are listed now; this is also covered by the enhanced test.
    
    The last bonus: The custom add-on actions are now only determined when there's actually completion of commands.
  3. test-lib: Allow completions containing whitespace.

    inkarkat committed Feb 28, 2012
    This is necessary to test the completion of task text.
  4. ENH: completion can use different todo.sh locations and configurations.

    inkarkat committed Feb 27, 2012
    This was previously not supported; todo_completion always used plain todo.sh from the PATH. Now it's possible to override the used executable (and configuration used through _todo_sh, set from a completion function wrapper.
    
    Cp. http://tech.groups.yahoo.com/group/todotxt/message/4003
  5. test-lib: Add test_todo_custom_completion variant.

    inkarkat committed Feb 27, 2012
    This extension of test_todo_completion additionally takes the completion function to use, so that customized completions for todo.sh aliases can be tested.
Commits on Feb 28, 2012
  1. Merge pull request #77 from inkarkat/complete-from-done

    ginatrapani committed Feb 28, 2012
    Complete from done
Commits on Feb 23, 2012
  1. test-lib: Also check completion exit code.

    inkarkat committed Feb 22, 2012
    The completion may unexpectedly abort somewhere.
    
    Additionally, reformat the failure messages (don't prepend a "*", this should be reserved to mark the individual test runs) and use "compreply" instead of "output", so that it's already clear from the diff output that the completion is being tested.
  2. test-lib: Avoid empty line in diff when no completion.

    inkarkat committed Feb 22, 2012
    There should be a trailing newline when there are completions (to avoid diff complaining about "no trailing newline", but not when there are no completions at all.
  3. Merge duplicate test files for listproj.

    inkarkat committed Feb 21, 2012
    t1260-listprj.sh was accidentally created; the tests should be in t1320-listproj.sh.
  4. ENH: completion offers projects and contexts from done.txt.

    inkarkat committed Feb 21, 2012
    This is useful when there are no open projects/contexts any more, but one wants to re-use an existing name.
  5. Add testing of todo_completion.

    inkarkat committed Feb 21, 2012
    Before adding any more features to todo_completion, I feel like I need test coverage, so this is a first stab at testing the completion results, via a new test function test_todo_completion.
    Some basic tests showcase the capabilities.
    
    Note: test-lib.sh now uses arrays, therefore all tests must use /bin/bash, not /bin/sh to avoid errors when sourcing test-lib. For consistency with todo.sh, we should have used Bash everywhere, anyway. Also note that t2000-multiline.sh needs some more quoting to avoid "Bash: ambiguous redirect" errors.
  6. ENH: TODOTXT_SOURCEVAR enables different source file for listcon.

    inkarkat committed Feb 21, 2012
    To be used by todo_completion (to offer candidates from done.txt when there are no matches in todo.txt), and maybe by custom addons.
Commits on Feb 21, 2012
  1. Merge pull request #76 from inkarkat/reintroduce-mawk-support

    ginatrapani committed Feb 21, 2012
    Revert to safer POSIX AWK regexp.
  2. Revert to safer POSIX AWK regexp.

    inkarkat committed Nov 3, 2011
    AWK from Ubuntu 8.04 (mawk) doesn't support [[:space:]]; so for backwards compatibility use a plain ASCII space instead.
Commits on Feb 15, 2012
  1. Merge pull request #75 from inkarkat/rid-tmp-file

    ginatrapani committed Feb 15, 2012
    Split up _list() and get rid of $TMP_FILE and cleanup().
  2. Merge pull request #74 from inkarkat/listpri-pri-range

    ginatrapani committed Feb 15, 2012
    ENH: Allow listpri filtering with priority ranges.
  3. Merge pull request #73 from inkarkat/testlib-enhancements

    ginatrapani committed Feb 15, 2012
    Testlib enhancements
    
    As the vast majority of tests uses the todo.sh output to verify its correctness, output differences should always be shown, not just in verbose mode. 
    
    This change removes the output redirection and check for exit code from the command-under-test, so as another benefit, these "housekeeping commands" are now kept off the test log.
    
    Also, by using a separate function for exit code assertion, this can now report both differences in output and exit code (and not suppress the former any more.)
    
    (Note: To see any of this, you need to temporarily introduce some test failures.)
    
    Finally, I've added color highlighting for the aggregate test report (as in test-lib), because it didn't stood out against the colored test results, so that I often missed the crucial summary.
Commits on Jan 26, 2012
  1. Also get rid of TMP_FILE in todo.cfg.

    inkarkat committed Jan 26, 2012
    There's a slight chance that some add-on has used this (undocumented, unofficial) configuration value for its own purposes (and maybe also relied on the unexposed cleanup() infrastructure), but detecting and fixing that problem (by moving the cleanup into the add-on itself) is pretty straightforward.
  2. Break up _list(), get rid of TMP_FILE.

    inkarkat committed Jan 26, 2012
    Extract a new function _format() (and getPadding(), both also exported for add-ons) from _list(), which includes the main formatting and filtering pipeline, without the file handling and verbose summary. This can receive the todo file via stdin, so the listall action is able to format the concatenated files without going through a temporary file.
    
    Eventually, after further refactorings, _format() could be used for actual formatted verbose messages in all commands; currently, the raw, unformatted task is printed.
  3. Get rid of cleanup, only use TMP_FILE in listall.

    inkarkat committed Jan 26, 2012
    After the recent refactorings, the temporary file is only needed for the listall action. Therefore, the creation-checks and eventual cleanup can be restricted to the listall action, which should slightly speed up the overall script execution.
  4. ENH: Allow listpri filtering with priority ranges.

    inkarkat committed Jan 26, 2012
    So far, the listpri action only supports a single priority. Allowing priority ranges (e.g. todo.sh listpri A-C @work) is a simple but useful enhancement.
    
    Note: The syntax extension only clashes with the [TERM] filtering in a few corner cases, and this can be worked around (e.g. "todo.sh listpri A-Z A-Z" lists all prioritized tasks containing the text A-Z).
  5. test-report: Use color highlighting as in test-lib.

    inkarkat committed Jan 26, 2012
    The test aggregate results are easy to miss when running the entire test suite via "make test", as the status of the last test case is highlighted, but the aggregate results appear in an unformatted, uncolored block of text.
    Copy the say_color() function from test-lib.sh. (Sorry for the duplication, I found no simple way to import or share just this piece of functionality without adding much complexity.)
    Successes, errors and broken summaries will now be highlighted in the appropriate colors (unless --no-color is given or output is not to a terminal), but only if the number is more than zero.
  6. test-lib: Show full todo.sh output in verbose mode.

    inkarkat committed Jan 25, 2012
    Now that differences in the output (and exit code) are already printed by default, we can make the verbose mode actually "verbose" by including all todo.sh output generated during the test run. This may help in reviewing the tests and for troubleshooting.
    By moving the redirection to the output file to test_run_(), all testing-related embellishments have been removed from the command under test itself, resulting in much cleaner test messages.
    Additionally, also capture stderr in output. todo.sh itself currently prints everything to stdout (but the die() output probably belongs to stderr), so as of now, that has no consequences, but seems to be more consistent and future-proof.
  7. test-lib: Separate function for exit code assertion.

    inkarkat committed Jan 25, 2012
    Remove the check for the todo.sh exit code (scripted via "=== N") from the command under test into a separate assertion test_expect_code_and_output. This allows for reporting of expected vs. actual exit code (also in the default non-verbose mode), and unexpected output from the same test is now reported, too.
  8. test-lib: Always print output differences, not just in verbose mode.

    inkarkat committed Jan 25, 2012
    Differences in the expected and actual todo.sh output are critical to analyzing the error, so they should always be printed, not just when the -verbose argument is given.
    
    This refactoring moves the test_cmp call from the command under test (as seen from test-lib's perspective) into a new assertion test_expect_output, derived from test_expect_success.
Commits on Jan 24, 2012
  1. Merge pull request #72 from inkarkat/list-optimization2

    ginatrapani committed Jan 24, 2012
    Optimization: Put grep -v empty task filter inside sed.