Skip to content

정리 시트의 머지 판정이 따라오지 않는 local main에 묶여 있다 #395

Closed

Description

@yansfil

The task you are doing when you want this

방금 머지된 워크트리도 정리 시트에서 바로 고르고 싶다.

What hide does today

정리 시트는 HEAD가 local main(refs/heads/main)에 들어 있거나, 머지된 PR의 merge commit이 local main에 있을 때만 그 워크트리를 고를 수 있게 한다(herdr-core/src/worktree_cleanup.rs).
루트 체크아웃의 main을 따라 올리는 주체가 없어서, 2026-10-04 local main은 origin/main보다 225커밋 뒤처져 있었다.
그 결과 HEAD가 origin/main에 들어 있던 28개 중 15개가 "Update main and review again"으로 제외됐다.

이 저장소는 머지 후 원격 브랜치를 지운다(delete_branch_on_merge).
그러나 로컬 upstream은 git fetch --prune 전까지 사라진 것으로 표시되지 않았다(2026-10-04 확인).

What it should do instead

  • GitHub에서 머지가 확인되고 PR head가 워크트리 HEAD와 같으면, local main이 뒤처져 있어도 고를 수 있다.
  • PR이 없는 워크트리는 fetch한 origin/main 기준으로도 판정한다.
  • 다른 브랜치를 base로 머지된 PR(예: Use short Unix homes for private desktop fixtures #374, base ci/platform-completion)은 그 base가 main에 들어간 뒤 정리 대상이 된다.

같은 계열 도구의 방식은 이렇다.

  • Worktrunk는 local main이 upstream보다 엄격히 뒤처져 있으면 upstream을 기준으로, 갈라졌으면 둘 다 기준으로 판정한다.
  • Orca는 기록된 base, origin/HEAD 순으로 보고, 필요하면 git fetch --prune 뒤 원격 ref로 다시 판정한다.
  • Mux는 local trunk가 origin/<trunk>의 조상일 때만 merge --ff-only로 따라 올리고, 갈라졌으면 로컬 상태를 쓴다.

Where the authority for it lives

머지 판정은 core의 herdr-core/src/worktree_cleanup.rs가 가지고, 머지된 PR 증명은 herdr-core/src/github.rs의 조회 결과를 쓴다.
루트 체크아웃을 fast-forward하는 쪽을 택하면 운영자의 체크아웃을 바꾸는 일이므로, 그 정책도 함께 정해야 한다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions