Query rule 'reports.<name>.range' for the specific default range of the report.
Use rule 'reports.range' to configure an overall default range for all reports.
Make internal reports 'summary', 'month', 'week', 'day', and 'gaps' use this feature.
Closes#477
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This patch checks if intervals are given on cli to 'timew export', and
if so will filter only those numbered IDs out from the db. This lets
the user that already knows the interval(s) they want to know about, to
ask for only those, without parsing the whole thing (similar to how we
can do this for taskwarrior IDs).
If both intervals and other filters -- time range or tags -- are given,
this is considered an error. There would seem to be little use to AND
or OR tags/ranges with IDs because anyone that knew IDs to request would
already know those IDs met their requirement.
Fixes#510
Code additions from @lauft PR notes (thanks!):
- factor out 'filtering' so we can do only one call to getTracked()
- simplify (tag || range) to .empty(), which already checks both
- error message phrasing
Signed-off-by: Scott Mcdermott <scott@smemsh.net>
Needed to allow database to be kept on some network filesystems
(GothenburgBitFactory/libshared#70).
fixes#465
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- Restores behaviour which got lost when switching to the new interval filtering in 9968b9e9
- Add test for each command
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
With 179a6153, all 'end of' named dates point to the last second of the respective interval.
(see GothenburgBitFactory/taskwarrior#2519)
Redefine hint intervals in Timewarrior by 'start of' named dates, such that their ranges comprise the full interval as expected.
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
- add config `reports.summary.ids` to toggle display of IDs
- add config `reports.summary.annotations` to toggle display of annotations
- add hints `:no-ids` and `:no-annotations` to override positive configs
Closes#474
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This eliminates the use of the naked "new" so that when the filters object is
destroyed, the filters are also freed.
This also eliminates a potential issue with binding an r-value reference to a
Range as a reference in IntervalFilterAllInRange.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Replace in commands CmdAnnotate, CmdDefault, CmdContinue, CmdTag, and CmdUntag
Also in function domGet
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
A first-of interval filter is done when the first matching interval has been found.
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
An and-group interval filter accepts all intervals which are accepted by all filters in its group.
It is done, if one of the filters in its group is done.
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Replace getTracked in commands CmdSummary, CmdChart, CmdExport, CmdFill,
CmdReport, CmdTags, and CmdContinue. Also in functions domGet and autoFill
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
An id-set interval filter accepts all intervals, which contain all ids of the given id set.
This filter is done when all ids have been found.
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
An all-in-range interval filter accepts all intervals which intersect with the given range.
This filter is done if it encounters an interval with an end datetime before its range's start datetime.
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
An all-with-tags interval filter accepts all intervals which contain all tags of the given tag set.
This filter is never done, i.e. it will consume all intervals from the stream.
Relates to #468
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
1) Remove AtomicFile::impl::find and use std::find_if directly.
2) Remove static functions that take a string for path. Allow the compiler to
construct the Path object as necessary.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
It is not sufficient to stop looking for matching intervals if the
interval start time is before the filter. We really want to make sure
that we pick up any intervals that intersect with the filter.
Fixes bug introduced in (a98bd14 "Simplify getIntervalsById and
getTracked") as part of #423.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>