Skip to content

Comments

Improve filtering and filter-related warnings#414

Merged
jotaen merged 6 commits intomainfrom
filtering
Feb 21, 2026
Merged

Improve filtering and filter-related warnings#414
jotaen merged 6 commits intomainfrom
filtering

Conversation

@jotaen
Copy link
Owner

@jotaen jotaen commented Feb 21, 2026

This PR restores the pre-v7.0 behaviour where the filters would keep empty records if they match the filter. E.g.,

2000-01-01

2000-01-02
#foo

2000-01-03
  1h #foo
  2h #bar
  • When filtering by date period --period 2000-01, all records match.
  • When filtering by tag --tag foo, both 2000-01-02 and the 1h entry in 2000-01-03 match.
  • When filtering by tag --tag bar, only the 2h entry in 2000-01-03 matches.
  • When filtering by tag --tag asdf, nothing matches.

Also, this PR introduces a new warning: if you apply entry-level filtering (resulting in partial records) and do --diff, it warns you that the result may be nonsensical. The reason is that the should-total always applies to the entire record. The warning(s) can be disabled in the config file or via the --no-warn flag.

Related #410.

# Conflicts:
#	klog/app/cli/args/filter.go
#	klog/app/cli/args/now.go
#	klog/app/cli/args/warn.go
#	klog/service/warning.go
@jotaen jotaen merged commit 1654220 into main Feb 21, 2026
8 checks passed
@jotaen jotaen deleted the filtering branch February 21, 2026 16:59
@jotaen jotaen mentioned this pull request Feb 21, 2026
jotaen added a commit that referenced this pull request Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant