Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#587 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, github, go
Área
cli, tooling

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 stack and 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/gh-stack

Todos los issues de github/gh-stack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.