You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fix review process to include uncommitted changes alongside committed changes
- Add fallback mechanism for base branch detection when origin/HEAD is not set
- Standardize timestamp format to YYYYMMDDTHHMM across all commands
- Add stash/restore protection to fix-pr workflow before git operations
- Add explicit cancel check after final await in async polling example
- Make stash/restore conditional on having uncommitted changes in codeit
- Add directory verification before destructive rm commands in debug-edge
Copy file name to clipboardExpand all lines: .cursor/skills/review-code/SKILL.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,11 @@ If a branch name is provided (not a PR):
44
44
```bash
45
45
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
46
46
```
47
+
If this command fails (common in forked repos or non-standard configs), use fallback detection:
48
+
- Try `git remote show origin | grep 'HEAD branch' | sed 's/.*: //'`
49
+
- If that fails, check if `origin/master` exists: `git rev-parse --verify origin/master`
50
+
- If not, check if `origin/main` exists: `git rev-parse --verify origin/main`
51
+
- Use whichever branch exists, defaulting to `master` if neither can be verified
47
52
5. If the branch has uncommitted or unstaged changes (no commits beyond the base), use `git diff` for unstaged changes and `git diff --cached` for staged changes instead of `git diff <base>...HEAD`. No git checkout operations are needed in this case.
48
53
6. Skip the GitHub MCP sections and proceed directly to **Review Process**
49
54
@@ -133,7 +138,7 @@ If branch checkout fails (e.g., fork was deleted, network issues), use the attac
133
138
## Review Process
134
139
135
140
1. Get the complete diff:
136
-
-**For local branches**: `git diff<base-branch>...HEAD`(e.g., `git diff master...HEAD`)
141
+
-**For local branches**: First check for uncommitted changes with `git diff` (unstaged) and `git diff --cached` (staged). If uncommitted changes exist, include them alongside `git diff <base-branch>...HEAD`so the review covers both committed and uncommitted work. If the branch has no commits beyond the base (HEAD equals base), use only `git diff` and `git diff --cached`.
137
142
-**For PRs with local checkout**: `git diff <base>...HEAD`
138
143
-**For PRs without checkout**: Read the attached diff from `/pull-requests/pr-<number>/all.diff`
0 commit comments