Skip to content

feat(git): prefix restore output with elapsed time#364

Closed
alecthomas wants to merge 1 commit into
mainfrom
aat/restore-timing-output
Closed

feat(git): prefix restore output with elapsed time#364
alecthomas wants to merge 1 commit into
mainfrom
aat/restore-timing-output

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

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.

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.
@alecthomas alecthomas requested a review from a team as a code owner June 26, 2026 01:51
@alecthomas alecthomas requested review from worstell and removed request for a team June 26, 2026 01:51
@alecthomas alecthomas enabled auto-merge (squash) June 26, 2026 01:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread cmd/cachew/git.go
}

fmt.Fprintf(os.Stderr, "Pulling from origin...\n") //nolint:forbidigo
log("Pulling from origin...\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread cmd/cachew/git.go
Comment on lines +62 to +63
// 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@alecthomas alecthomas closed this Jun 26, 2026
auto-merge was automatically disabled June 26, 2026 02:08

Pull request was closed

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