Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: a stray .DS_Store in .git/worktrees makes every gh stack command fail

Aperta Adatta ai principianti
#587 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, github, go
Ambito
cli, tooling

Direzione di ricerca

Inizia tracciando la migrazione dello stato legacy dello stack che esamina .git/worktrees/, identificata dall’errore come punto del problema. Riproduci il problema con i passaggi indicati per git worktree e .DS_Store, quindi esegui i test di migrazione pertinenti. Il lavoro è completato quando le voci che non sono directory vengono ignorate e gh stack view, add e link funzionano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

A regular file inside .git/worktrees/ makes every gh stack command fail. On macOS, Finder drops a .DS_Store there as soon as someone opens the directory, so a repo that uses worktrees can end up with one without anyone noticing.

From the error, the state migration treats every entry of .git/worktrees/ as a worktree admin dir and gives up on the first one that isn't a directory. Skipping non-directories there would be enough.

Affected command

gh stack link (also gh stack view, gh stack add)

gh-stack version

gh stack version 0.2.1

GitHub CLI version

gh version 2.102.1 (2026-10-20)

Operating system

macOS 27.0.1

Shell

zsh

Steps to reproduce
git init -b main repo && cd repo
git commit --allow-empty -m init
git worktree add ../wt -b feature
touch .git/worktrees/.DS_Store
gh stack view
gh stack add test-branch

No remote is needed. I hit it on a real repo first, running gh stack link over three pushed branches.

Expected behavior

Files that aren't directories in .git/worktrees/ are skipped, and the command runs.

Actual behavior

The command fails before it does anything. Removing the .DS_Store fixes it.

Terminal output
$ gh stack view
✗ checking legacy stack state: worktree administration path "/…/repo/.git/worktrees/.DS_Store" is not a directory

$ gh stack add test-branch
✗ migrating stack state: worktree administration path "/…/repo/.git/worktrees/.DS_Store" is not a directory
Preflight checks
  • I searched the existing issues for duplicates.
  • I ran gh extension upgrade stack and reproduced this issue on the latest stable release.

— printed by Claude Code, signed by me.

Lingua principale
Go
Stelle
1.7k
Fork
82
Merge medio
1g 22m
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/gh-stack

Tutte le issue di github/gh-stack

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.