Skip to content

fix: resolve short SHAs in daemon cherry-pick synthesis#806

Merged
svarlamov merged 2 commits intomainfrom
fix/daemon-cherry-pick-short-sha
Mar 26, 2026
Merged

fix: resolve short SHAs in daemon cherry-pick synthesis#806
svarlamov merged 2 commits intomainfrom
fix/daemon-cherry-pick-short-sha

Conversation

@svarlamov
Copy link
Member

@svarlamov svarlamov commented Mar 26, 2026

Summary

  • The daemon's cherry-pick source commit extraction only accepted full 40/64-char OIDs via is_valid_oid, silently dropping short SHAs (e.g. 757da0) and symbolic refs (e.g. branch names) passed on the command line
  • Renamed cherry_pick_source_commits_from_commandcherry_pick_source_refs_from_command to collect all positional args as potential commit refs
  • Added resolve_cherry_pick_source_refs that expands unresolved refs to full OIDs via git rev-parse in the async side-effect path (not the daemon critical path), mirroring the existing pattern used for merge-squash source resolution
  • Added daemon integration test that cherry-picks using a 7-char short SHA and verifies cherry_pick_complete is emitted with the full resolved SHA

Test plan

  • New test daemon_pure_trace_socket_cherry_pick_with_short_sha_emits_complete_event passes
  • All 136 existing cherry-pick tests pass
  • All 3 daemon cherry-pick tests pass (abort, continue, new short-sha)
  • CI passes on both macOS and Ubuntu

🤖 Generated with Claude Code


Open with Devin

…esis

The daemon's cherry-pick source commit extraction only accepted full
40/64-char OIDs, silently dropping short SHAs and branch names. This
caused "missing cherry-pick source commits" errors when users ran
e.g. `git cherry-pick abc123` instead of the full SHA.

Now collects all positional args as potential commit refs, then resolves
them to full OIDs via `git rev-parse` in the async side-effect path
(not the daemon critical path). This mirrors the existing pattern used
for merge-squash source resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Apply rustfmt formatting and add a regression test verifying that
`git rebase <short-sha>` correctly emits rebase_complete in daemon
mode. Rebase already handles this via fallback paths (unlike
cherry-pick which had a hard failure).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@svarlamov svarlamov merged commit 2d86a2e into main Mar 26, 2026
21 checks passed
@svarlamov svarlamov deleted the fix/daemon-cherry-pick-short-sha branch March 26, 2026 13:17
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