mirror of https://github.com/garrytan/gstack.git
docs: avoid detached post-merge worktrees
This commit is contained in:
parent
0424668fe9
commit
05f19d7f12
|
|
@ -1489,7 +1489,7 @@ MERGE_SHA=$(gh pr view --json mergeCommit -q .mergeCommit.oid)
|
|||
git fetch origin "$BASE"
|
||||
git diff --quiet "$MERGE_SHA" origin/"$BASE" || git log --oneline --decorate -1 "$MERGE_SHA" origin/"$BASE"
|
||||
```
|
||||
- If the worktree is clean and only needs to stop looking diverged after a squash merge, prefer non-destructive cleanup such as `git switch --detach "$MERGE_SHA"` for throwaway task worktrees. Do not force-push or reset a user's branch unless they explicitly ask.
|
||||
- If the worktree is clean and only needs to stop looking diverged after a squash merge, prefer a named local branch at the merge commit, for example `git switch -c "codex/post-merge-pr-$PR_NUMBER" "$MERGE_SHA"`. Avoid detached HEAD in Codex Desktop worktrees because git action workers often expect `git symbolic-ref --short HEAD` to return a branch. Do not force-push or reset a user's branch unless they explicitly ask.
|
||||
|
||||
Worktree cleanup — non-destructive, candidate-based:
|
||||
```bash
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ MERGE_SHA=$(gh pr view --json mergeCommit -q .mergeCommit.oid)
|
|||
git fetch origin "$BASE"
|
||||
git diff --quiet "$MERGE_SHA" origin/"$BASE" || git log --oneline --decorate -1 "$MERGE_SHA" origin/"$BASE"
|
||||
```
|
||||
- If the worktree is clean and only needs to stop looking diverged after a squash merge, prefer non-destructive cleanup such as `git switch --detach "$MERGE_SHA"` for throwaway task worktrees. Do not force-push or reset a user's branch unless they explicitly ask.
|
||||
- If the worktree is clean and only needs to stop looking diverged after a squash merge, prefer a named local branch at the merge commit, for example `git switch -c "codex/post-merge-pr-$PR_NUMBER" "$MERGE_SHA"`. Avoid detached HEAD in Codex Desktop worktrees because git action workers often expect `git symbolic-ref --short HEAD` to return a branch. Do not force-push or reset a user's branch unless they explicitly ask.
|
||||
|
||||
Worktree cleanup — non-destructive, candidate-based:
|
||||
```bash
|
||||
|
|
|
|||
Loading…
Reference in New Issue