ishaan812/Emdash/feat UI option merge to local#1295
ishaan812/Emdash/feat UI option merge to local#1295ishaan812 wants to merge 5 commits intogeneralaction:mainfrom
Conversation
|
@ishaan812 is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR introduces a "Local Merge" action to the PR action dropdown, allowing users to merge a worktree branch directly into the local default branch without creating a PR or pushing to remote. It also refactors shared git logic (branch detection, staging/committing) into reusable helpers used by both the existing merge-to-main and the new local-merge flow. Key changes:
Two bugs in Minor style issue in Confidence Score: 2/5
Sequence DiagramsequenceDiagram
participant UI as FileChangesPanel
participant IPC as git:local-merge (main)
participant WT as Worktree (taskPath)
participant MR as Main Repo (mainRepoPath)
UI->>UI: User clicks "Local Merge"
UI->>UI: Show confirmation dialog
UI->>IPC: localMerge({ taskPath, commitMessage? })
IPC->>WT: git branch --show-current
WT-->>IPC: currentBranch
IPC->>WT: gh / git symbolic-ref (detectDefaultBranch)
WT-->>IPC: defaultBranch
IPC->>WT: git status --porcelain (stageAndCommit)
WT-->>IPC: dirty?
IPC->>WT: git add -A + git commit (if dirty)
IPC->>WT: git rev-parse --git-common-dir
WT-->>IPC: commonDir → mainRepoPath
IPC->>MR: git checkout defaultBranch
MR-->>IPC: ok / error
alt checkout succeeds
IPC->>MR: git merge currentBranch -m commitMessage
MR-->>IPC: merged / conflicts
alt conflicts
IPC->>MR: git merge --abort
end
end
IPC-->>UI: { success, output, defaultBranch, featureBranch } / { error }
UI->>UI: toast + refreshChanges()
Last reviewed commit: 5e84bf6 |
Add a "Local Merge" option to the PR action dropdown in the file changes
panel. This merges the worktree branch directly into the default branch
in the local repository.
A confirmation dialog warns the user about what will happen and allows
them to optionally customize the merge commit message.
Backend:
git:local-mergeIPC handler that stages pending changes, resolvesthe main repo via git-common-dir, checks out the default branch, and
merges the feature branch (with conflict recovery via merge --abort)
stageAndCommit) to deduplicate logic between merge-to-main and
local-merge handlers
Frontend:
explanation, and optional commit message input
executeMergehelper to deduplicate handleMergeToMainand handleLocalMerge
Closes #1269