Skip to content

fix(config): Refresh stored target metadata#14813

Closed
reneleonhardt wants to merge 1 commit into
gitbutlerapp:masterfrom
reneleonhardt:fix/target-metadata-refresh
Closed

fix(config): Refresh stored target metadata#14813
reneleonhardt wants to merge 1 commit into
gitbutlerapp:masterfrom
reneleonhardt:fix/target-metadata-refresh

Conversation

@reneleonhardt

@reneleonhardt reneleonhardt commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🧢 Changes

  • Add but config target --refresh to update the stored target commit from the
    already configured remote-tracking ref.
  • Keep but config target --push-remote <remote> working without a positional
    target branch.
  • Preserve target identity, refs, workspace, branch tips, index, and worktree.
  • Reject refresh while named or anonymous stacks are applied, and reject a
    simultaneous target change.
  • Normalize fully qualified remote-ref input.

☕️ Reasoning

Fetching can advance the configured remote-tracking ref while the project keeps
an older stored target commit. Re-selecting the same target intentionally
preserves that commit, leaving no supported metadata-only repair.

An explicit refresh provides a bounded recovery path without pulling, moving a
protected local default branch, or disturbing workspace state. This is useful
for human and agentic coding workflows that separate remote refresh from
workspace integration.

🧪 Reproduction

but pull --check
but config target --refresh

Before this fix, the first command could advance the configured tracking ref
while the stored target commit remained stale. Re-selecting the same target was
intentionally a no-op.

✅ Verification

  • Focused workspace, parser, CLI, and push-remote compatibility tests passed.
  • The tests cover idempotence, applied-stack rejection, and preservation of
    refs, HEAD, workspace, index, worktree, target name, and push remote.
  • Formatting, warnings-denied Clippy with --no-default-features, focused diff
    review, and commit-signature verification passed.

Developed with carefully directed, manually reviewed AI assistance.

Co-Authored-By: GPT-5.6 Sol codex@openai.com

Add an explicit metadata-only target refresh so agentic coding can repair stale target state without moving protected refs or workspace history.

Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
@reneleonhardt
reneleonhardt force-pushed the fix/target-metadata-refresh branch from 8347710 to 3ca19c3 Compare July 19, 2026 09:35
@Byron

Byron commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for tackling this.

However, I think it's best to close it and wait for a couple of other fixes to land that might affect it positively.

@Byron Byron closed this Jul 20, 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.

2 participants