Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/hook/remind_main_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ main() {

if [[ "${cleaned}" =~ --auto([[:space:]]|$) ]]; then
variant="queued"
msg="Auto-merge queued. After CI passes and GitHub completes the merge, run \`git -C \$(git rev-parse --show-toplevel 2>/dev/null) pull --ff-only origin main\` (or the same from your main checkout) to keep local main tracking origin/main HEAD. See doc/process/worktree.md ("Lifecycle > Cleanup")."
msg="Auto-merge queued. After CI passes and GitHub completes the merge, run \`git -C \$(git rev-parse --show-toplevel 2>/dev/null) pull --ff-only origin main\` (or the same from your main checkout) to keep local main tracking origin/main HEAD. See doc/process/worktree.md (\"Lifecycle > Cleanup\")."
else
variant="immediate"
msg="PR merged. Run \`git pull --ff-only origin main\` on your main checkout now so local main keeps tracking origin/main HEAD (don't let it freeze behind). See doc/process/worktree.md ("Lifecycle > Cleanup")."
msg="PR merged. Run \`git pull --ff-only origin main\` on your main checkout now so local main keeps tracking origin/main HEAD (don't let it freeze behind). See doc/process/worktree.md (\"Lifecycle > Cleanup\")."
fi

jq -n --arg m "${msg}" --arg v "${variant}" '{
Expand Down
Empty file removed Cleanup).
Empty file.
6 changes: 6 additions & 0 deletions doc/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ not deferred to release. `release-tag.sh` promotes `[Unreleased]` →

## [Unreleased]

### Fixed

- Restore Windows checkout by removing the empty tracked `Cleanup).` artifact
and escaping lifecycle-reference quotes in both merge reminders so they no
longer create a stray file (refs #409).

### Deprecated

- **Legacy `small-tools/` bundle installers marked DEPRECATED** (PRD section
Expand Down
24 changes: 24 additions & 0 deletions test/unit/hook/remind_main_sync_spec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ _run_hook() {
run bash -c 'printf "%s" "$1" | "$2"' _ "$(_json "$1")" "${HOOK_SH}"
}

_assert_reminder_has_no_filesystem_side_effects() {
local command="$1" variant="$2" cwd message
cwd="${INIT_UBUNTU_TEST_SCRATCH}/hook_cwd"
mkdir -p "${cwd}"

run bash -c 'cd -- "$3" && printf "%s" "$1" | "$2"' \
_ "$(_json "${command}")" "${HOOK_SH}" "${cwd}"

[ "${status}" -eq 0 ]
[ -z "$(find "${cwd}" -mindepth 1 -print -quit)" ]
message="$(printf '%s' "${output}" | jq -er '.systemMessage')"
[[ "${message}" == *'See doc/process/worktree.md ("Lifecycle > Cleanup").' ]]
printf '%s' "${output}" | jq -e --arg m "${message}" --arg v "${variant}" \
'.hookSpecificOutput.additionalContext == ($m + " [variant=" + $v + "]")'
}

# ── fires: real gh pr merge ──────────────────────────────────────────────────

@test "gh pr merge --auto -> queued variant reminder" {
Expand All @@ -37,6 +53,14 @@ _run_hook() {
[[ "${output}" == *"pull --ff-only"* ]]
}

@test "queued reminder preserves quoted lifecycle reference without creating files" {
_assert_reminder_has_no_filesystem_side_effects "gh pr merge --auto --squash 42" "queued"
}

@test "immediate reminder preserves quoted lifecycle reference without creating files" {
_assert_reminder_has_no_filesystem_side_effects "gh pr merge --squash 42" "immediate"
}

@test "gh pr merge at a command boundary after && still fires" {
_run_hook "gh pr checks 42 && gh pr merge --rebase 42"
[ "${status}" -eq 0 ]
Expand Down
Loading