Repository navigation
fix(cli): search all rg words and send date filters in seconds - #314
Merged
Merged
Conversation
- `shelltime rg git sub` searched only "git" because just the first arg was used; join every arg into one search phrase. - --since/--until were sent as unix milliseconds while the server reads seconds, so any date filter matched nothing. - A lone --since or --until sent a single value, which the server reads as "that one day"; always send a [start, end] range instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EcWEjASeNtz3QVVtf1wLXp
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three bugs in
shelltime rg(commands/grep.go):searchText := c.Args().First()meantshelltime rg git subsearched forgit, andsubwas dropped without any warning.--since/--untilwere sent asUnixMilli(), but the server'sCommandFilter.timeis in unix seconds (time.Unix(sec, 0)). Every date filter landed around the year 56000 and matched nothing.--sinceor--untilmatched only one day. When the server gets a single time value, it reads it as "that one day", not as an open-ended range.The main reason
rgmissed older commands was on the server: CLI calls were limited to the last 7 days. That is fixed in shelltime/server on the branch of the same name.Fix
rg git subandrg "git sub"give the same results. The usage error now saysshelltime rg <search-text>.[start, end]pair in seconds. A missing side is filled in: epoch forstart, now forend.Tests
TestBuildGrepFilter_SinceAndUntilTimeWindownow expects seconds. It previously asserted the millisecond bug.TestBuildGrepFilter_SinceOnlyRunsUntilNowandTestBuildGrepFilter_UntilOnlyStartsAtEpoch.TestCommandGrep_UnquotedWordsFormOnePhrase: runsrg git subagainst an httptest GraphQL server and checks that the request'sfilter.commandis"git sub".go vet ./commands/andgo test ./commands/pass locally, aftermockery.🤖 Generated with Claude Code
https://claude.ai/code/session_01EcWEjASeNtz3QVVtf1wLXp
Generated by Claude Code