GothenburgBitFactory / GothenburgBitFactory/taskwarrior

Add a way to specify the date of an annotation

Open
#2,209 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.1k
Forks
423
Avg merge
1d 19h
Merged PRs (30d)
11

Description

I'm currently playing around with taskwarrior to replace a number of text files and other task tracking tools and like it a lot. Thanks everyone for your work!

One thing I've been unable to figure out is how to set the date of an annotation. I often add notes to my tasks (e.g. important status updates), and very frequently this happens only a bit later because I focus on getting the actual task done, not documenting it. So I might come back half an hour later and want to add a note with the appropriate time.

Example usage:

task add Do X
task 1 start
# half an hour later...
task 1 annotate Restarted due to an issue with Y

In this particular case of "restarting", I could also reset the start date; however, the note of *why* it was restarted should still have an accurate date.

Here's what I've tried:

* `task ID annotate TEXT entry:DATETIME` – This was inspired by the JSON output of `task ID export`. However, this changes the date of the entire task's entry to that value rather than of the annotation.
* `task ID annotate TEXT annotation.entry:DATETIME` (and `annotation_entry:DATETIME) – Again inspired by the JSON output since the `entry` field is stored within the annotation. This simply adds that part to the annotation text.
* `task ID annotate TEXT date:DATETIME` (and `datetime:DATETIME`) – Same result.

At this point, I looked a bit into the source code and the internal data structures and noticed that annotations are actually stored in an `annotation_X` key where `X` is the unix timestamp. So I also tried:

* `task ID modify annotation_$(date --date=DATETIME +%s):TEXT` – This replaces the task's description.

Unless I missed something obvious (certainly possible, especially since `annotate` isn't well-documented), it doesn't seem to be possible to do this except through messing directly with taskwarrior's data directory.

I suggest using the `task FILTER annotate TEXT entry:DATETIME` syntax for this.

On a related note, it would be good if there were also a way to modify the annotation (both text and date) after adding it. However, that's not as important since you can always delete and readd the annotation if needed, and `info` presumably sorts by the annotation date/key anyway.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.