Hello,
I find that 'context' feature is a wonderful one enabling one to nicely organize one's tasks and not depend solely on projects and tag, so here I'm proposing to add ability to (mod)ify contexts by adding/removing tags used when the context was define.
It's not easy to fully figure out all the details of the context in advance, so it would be nice to be able to add new tags and/or remove tags used when the context was originally defined, so I believe it's could be generally useful to modify already defined context besides the currently implemented functions of clearing, deleting, listing etc.
Sincerely,
Gour
Hi - wouldn't it be easier to simply delete the existing context and recreate it using the new tags you prefer?
@hammerheadlemon Well, that involves one operation too much, but, yes, it can be done that way, but then the tool loses its orthogonality, iow. why mod(ifying) the task and not simply deleting it and re-creating it?
It's not a built-in command, but you can always edit the .taskrc file.
I have a shell alias task_context set up to match task rc:~/.task_contexts context which allows me to handle context definitions in a separate file. I then source this additional file in my normal taskrc with include ~/.task_contexts.
This allows me to manage contexts with a single command without cluttering my dotfiles with untracked changes on .taskrc.
Furthermore, you can also change existing context definitions by simply redefining a context. Taskwarrior will automatically ask for confirmation of any changes so you can try it out without having to worry about overwriting anything you did not want to achieve.
I think additional commands for adding or removing tags from a context definition causes too many edge cases where they won't be sufficient. Just a few examples that come to my mind are that you can use logical ORs or ANDs and that context are not limited to tags being the filter.
Contexts are just configuration entries in the taskrc and hence can be edited as any other setting. Maybe documentation needs to be clearer on this topic?
Technically we could also make "modify" an alias for "define" :) but that might be just confusing.
Most helpful comment
I have a shell alias
task_contextset up to matchtask rc:~/.task_contexts contextwhich allows me to handle context definitions in a separate file. I then source this additional file in my normal taskrc withinclude ~/.task_contexts.This allows me to manage contexts with a single command without cluttering my dotfiles with untracked changes on .taskrc.
Furthermore, you can also change existing context definitions by simply redefining a context. Taskwarrior will automatically ask for confirmation of any changes so you can try it out without having to worry about overwriting anything you did not want to achieve.
I think additional commands for adding or removing tags from a context definition causes too many edge cases where they won't be sufficient. Just a few examples that come to my mind are that you can use logical ORs or ANDs and that context are not limited to tags being the filter.