[Bug]: a stray .DS_Store in .git/worktrees makes every gh stack command fail
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza siguiendo la migración del estado de la pila heredada que examina .git/worktrees/, que el error identifica como el punto de fallo. Reproduce el problema con los pasos indicados para git worktree y .DS_Store; después, ejecuta las pruebas pertinentes de migración. Se considera terminado cuando se omiten las entradas que no son directorios y funcionan gh stack view, add y link.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 stackand reproduced this issue on the latest stable release.
— printed by Claude Code, signed by me.
- Lenguaje dominante
- Go
- Estrellas
- 1.7k
- Forks
- 82
- Merge medio
- 1 d 22 min
- PR fusionados (30 d)
- 25
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/gh-stack
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
github/gh-stack#518 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
feature request topic: cli - general
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
Todos los issues de github/gh-stack
Issues similares
-
status:needs-review type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Gentleman-Programming/engram#2079 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
limitlessprojects/Go-Hybrid#1377 ·
Los mantenedores suelen responder en 1 día
-
bug report
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día