← 输入框|github.com|刷新
Skip to content

fix(skill): find the draft message file in worktrees and submodules - #686

Merged
shenxianpeng merged 1 commit into
mainfrom
fix/skill-draft-path-in-worktrees
Nov 10, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
fix/skill-draft-path-in-worktrees

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

What

The agent skill told the agent to write a multi-line draft to .git/COMMIT_MSG_DRAFT. In a worktree or a submodule, .git is a file, not a directory, so the write fails. The skill now gets the path from git rev-parse --git-path COMMIT_MSG_DRAFT, which resolves correctly in all three cases, and says to commit with git commit -F "$draft".

Before vs after

In a worktree created with git worktree add:

Command Result
Before printf 'feat: x\n' > .git/COMMIT_MSG_DRAFT Not a directory
After draft="$(git rev-parse --git-path COMMIT_MSG_DRAFT)" /repo/.git/worktrees/<name>/COMMIT_MSG_DRAFT; commit-check --message --compact "$draft" exits 0

In a normal checkout, $draft is still .git/COMMIT_MSG_DRAFT.

Tests

tests/skill_test.py passes, so every flag the skill uses still exists.

The skill wrote the draft to .git/COMMIT_MSG_DRAFT, which fails in a
worktree or a submodule, where .git is a file. It now asks
git rev-parse --git-path for the location.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 10, 2026 05:47
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 970e7cfd-263c-422b-ac2d-2ff0f922454e
Commits

Reviewing files that changed from the base of the PR and between c58b1ea and 3206e4d.

Files selected for processing: 1

  • skills/commit-check/SKILL.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the bug Something isn't working label Nov 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@shenxianpeng shenxianpeng self-assigned this Nov 10, 2026
@shenxianpeng
shenxianpeng merged commit 878482c into main Nov 10, 2026
10 checks passed
@shenxianpeng
shenxianpeng deleted the fix/skill-draft-path-in-worktrees branch November 10, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant