Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local todo.txt for project specific task lists #187

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jammon
Copy link

@jammon jammon commented Jul 31, 2016

I tend to have rather long task lists for single projects filling up my global todo.txt. Although I can tag them with "@my_project" I don't like the confusingly long task list.

So I extracted the project specific task into local todo.txt files, that I can add to the project's git repo. This change to todo.sh makes it search up the directory path for a local todo.txt and use this if it finds any. The default behaviour is unchanged (not looking for local todo.txt), but you can turn on using local task lists with -l or TODOTXT_USE_LOCAL=1.

@karbassi karbassi added this to the Version 2.12.0 milestone Mar 26, 2018
@AlexandreRoba
Copy link

Works like a charm. Lost an hour trying to play with TODO_DIR, TODO_FILE... on mac os and zsh and could not sort it out. IMHO This is a good candidate as default behavior.

Copy link
Member

@inkarkat inkarkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea. I can see the benefits, and the implementation looks solid. However, I think we need test coverage for:

  • local directories
  • the directory climbing
  • falling back to the global location
  • overrides via DONE_FILE, REPORT_FILE to collect archived tasks / reports globally

todo.sh Outdated Show resolved Hide resolved
todo.cfg Outdated Show resolved Hide resolved
@karbassi
Copy link
Member

@jammon or @inkarkat, could one of you two write some test for this. I know others would love this feature merged.

@inkarkat
Copy link
Member

inkarkat commented Oct 10, 2024

In the meantime, I've solved this via a wrapper script that has additional special handling for Git repositories (short-lived tactical development project-related tasks that should not pollute the main todo.txt file are my main use case).

Global or local task list, for the latter using a todo.txt found in the current
directory or one of its parents, and auto-archives into .git/todo if within a
Git working copy or else into ~/.local/share/todo-local/<path+to+dir>/done.txt
Create an empty local task list via
"touch todo.txt" or "todo-local.sh init [DIR]" (or initialize a Git repo here).

That doesn't mean I'm against adding local file support to the main script. But as my example shows, just traversing the current directory upwards may be too simplistic to be useful, and custom solutions are easy to build or reuse (like custom add-ons). And we haven't seen any more requests for this in the past five years...

@inkarkat inkarkat removed their assignment Oct 10, 2024
Copy link
Member

@inkarkat inkarkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rebase and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants