feat(git): prefix restore output with elapsed time#364
Conversation
Every `cachew git restore` status line is now prefixed with the time elapsed since the restore started, via a closure passed to each step, making it easy to see where time goes. The standalone total-elapsed line is dropped since the last line already shows it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 743ed84837
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| fmt.Fprintf(os.Stderr, "Pulling from origin...\n") //nolint:forbidigo | ||
| log("Pulling from origin...\n") |
There was a problem hiding this comment.
Log after successful origin pulls
When --ref/--commit falls through to a real git pull, this log call is emitted before gitPullOrigin() starts, and on success satisfyRefs returns without another status line. Since this commit removed the deferred total-elapsed line from Run, successful restores that spend time pulling from origin now report their final elapsed timestamp before the potentially long pull, hiding exactly where that time went; add a completion log after gitPullOrigin or restore a final elapsed log.
Useful? React with 👍 / 👎.
| // logFunc writes a status line to stderr prefixed with the time elapsed since | ||
| // the restore started, so every step is timestamped on its own line. |
There was a problem hiding this comment.
Remove the rule-violating helper comments
/workspace/cachew/AGENTS.md says, "Only add comments for relatively large blocks of code, 20+ lines or more" and that comments should explain why rather than what; this new doc comment, and the matching newLogFunc one below, documents a one-line helper/type and restates what the code does, so it violates the local commenting rule. Please remove it unless there is a non-obvious reason that needs documenting.
Useful? React with 👍 / 👎.
Pull request was closed
Every
cachew git restorestatus line is now prefixed with the timeelapsed since the restore started, via a closure passed to each step,
making it easy to see where time goes. The standalone total-elapsed line
is dropped since the last line already shows it.