tbabej / vit

Placeholder to demostrate issue porting for VIT.
0 stars 0 forks source link

[VT-133] Allow multiple per-directory task customisations and databases #132

Open tbabej opened 6 years ago

tbabej commented 6 years ago

JM Marcastel on 2017-06-21T14:12:48Z says:

Below a small snippet which when included in the initialisation phase allows to have task databases per directory rather than per user's home directory. For instance, have a task database per project in your development sandbox.

  {code:none} use Cwd; use File::Basename;

  1. Scan this and parent directories for taskwarrior customisations my $pwd = cwd(); while ($pwd ne '/' && $pwd ne $ENV{'HOME'}) { my $count=0; $task = "TASKRC=$pwd/.taskrc $task", ++ $count if -f "$pwd/.taskrc"; $task = "TASKDATA=$pwd/.task $task", ++ $count if -d "$pwd/.task"; last if $count > 0; $pwd = dirname ($pwd); } {code}  
tbabej commented 6 years ago

Migrated metadata:

Created: 2017-06-21T14:12:48Z
Modified: 2017-06-21T18:11:36Z
tbabej commented 6 years ago

Scott Kostyshak on 2017-06-21T18:11:36Z says:

[~don] thanks for this report! That patch indeed seems useful. I'm not convinced that such functionality belongs in VIT. If anything, it would be in Taskwarrior itself, but I'm not even convinced that it belongs there. This idea is similar to local-task.sh, which is listed at https://taskwarrior.org/tools/ and resulted from TW-514. That script is a little different from your proposal because I don't think it searches upward. When motivated your script compared to local-task.sh, you should mention that Git has this behavior.