4 Commits

Author SHA1 Message Date
Mark Wylde
a8399fe052 Merge pull request #2 from zinglax/shallow-fetch
Adding --depth=1 to fetchs to save time for large repos
2025-06-06 08:54:50 +01:00
zinglax
f640f38102 Adding --depth=1 to fetchs to save time
See https://github.com/anthropics/claude-code-action/issues/52
2025-06-04 09:44:05 -04:00
Mark Wylde
54147e92b6 fix: follow commit convention 2025-06-01 12:21:05 +01:00
Mark Wylde
42d3e56b56 fix: encourage use of mcp__gitea__list_branches 2025-05-31 13:54:12 +01:00
3 changed files with 6 additions and 4 deletions

View File

@@ -536,7 +536,7 @@ ${
? ` ? `
4. Check for Existing Branch (for issues and closed PRs): 4. Check for Existing Branch (for issues and closed PRs):
- Before implementing changes, check if there's already a claude branch for this ${eventData.isPR ? "PR" : "issue"}. - Before implementing changes, check if there's already a claude branch for this ${eventData.isPR ? "PR" : "issue"}.
- Use Bash to run \`git branch -r | grep "claude/${eventData.isPR ? "pr" : "issue"}-${eventData.isPR ? eventData.prNumber : eventData.issueNumber}"\` to search for existing branches. - Use the mcp__gitea__list_branches tool to list branches.
- If found, use mcp__local_git_ops__checkout_branch to switch to the existing branch (set fetch_remote=true). - If found, use mcp__local_git_ops__checkout_branch to switch to the existing branch (set fetch_remote=true).
- If not found, you'll create a new branch when making changes (see Execute Actions section). - If not found, you'll create a new branch when making changes (see Execute Actions section).
- Mark this todo as complete by checking the box. - Mark this todo as complete by checking the box.
@@ -566,6 +566,7 @@ ${
eventData.isPR && !eventData.claudeBranch eventData.isPR && !eventData.claudeBranch
? ` ? `
- Commit changes using mcp__local_git_ops__commit_files to the existing branch (works for both new and existing files). - Commit changes using mcp__local_git_ops__commit_files to the existing branch (works for both new and existing files).
- Make sure commits follow the same convention as other commits in the repository.
- Use mcp__local_git_ops__commit_files to commit files atomically in a single commit (supports single or multiple files). - Use mcp__local_git_ops__commit_files to commit files atomically in a single commit (supports single or multiple files).
- CRITICAL: After committing, you MUST push the branch to the remote repository using mcp__local_git_ops__push_branch - CRITICAL: After committing, you MUST push the branch to the remote repository using mcp__local_git_ops__push_branch
- After pushing, you MUST create a PR using mcp__local_git_ops__create_pull_request. - After pushing, you MUST create a PR using mcp__local_git_ops__create_pull_request.
@@ -574,6 +575,7 @@ ${
? ` ? `
- You are already on the correct branch (${eventData.claudeBranch}). Do not create a new branch. - You are already on the correct branch (${eventData.claudeBranch}). Do not create a new branch.
- Commit changes using mcp__local_git_ops__commit_files (works for both new and existing files) - Commit changes using mcp__local_git_ops__commit_files (works for both new and existing files)
- Make sure commits follow the same convention as other commits in the repository.
- Use mcp__local_git_ops__commit_files to commit files atomically in a single commit (supports single or multiple files). - Use mcp__local_git_ops__commit_files to commit files atomically in a single commit (supports single or multiple files).
- CRITICAL: After committing, you MUST push the branch to the remote repository using mcp__local_git_ops__push_branch - CRITICAL: After committing, you MUST push the branch to the remote repository using mcp__local_git_ops__push_branch
` `

View File

@@ -52,7 +52,7 @@ export async function setupBranch(
); );
// Check out the base branch and let Claude create branches as needed // Check out the base branch and let Claude create branches as needed
await $`git fetch origin ${sourceBranch}`; await $`git fetch origin --depth=1 ${sourceBranch}`;
await $`git checkout ${sourceBranch}`; await $`git checkout ${sourceBranch}`;
await $`git pull origin ${sourceBranch}`; await $`git pull origin ${sourceBranch}`;
@@ -99,7 +99,7 @@ export async function setupBranch(
// Ensure we have the latest version of the source branch // Ensure we have the latest version of the source branch
console.log(`Fetching latest ${sourceBranch}...`); console.log(`Fetching latest ${sourceBranch}...`);
await $`git fetch origin ${sourceBranch}`; await $`git fetch origin --depth=1 ${sourceBranch}`;
// Checkout the source branch // Checkout the source branch
console.log(`Checking out ${sourceBranch}...`); console.log(`Checking out ${sourceBranch}...`);

View File

@@ -85,7 +85,7 @@ export async function branchHasChanges(
*/ */
export async function fetchBranch(branchName: string): Promise<boolean> { export async function fetchBranch(branchName: string): Promise<boolean> {
try { try {
await $`git fetch origin ${branchName}`; await $`git fetch origin --depth=1 ${branchName}`;
return true; return true;
} catch (error) { } catch (error) {
console.log( console.log(