Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#587 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, github, go
Domain
cli, tooling

Research direction

Start by tracing the legacy stack state migration that scans .git/worktrees/, which the error identifies as the failure point. Reproduce with the listed git worktree and .DS_Store steps, then run the relevant migration tests. Done means non-directory entries are skipped and gh stack view, add, and link proceed.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
1.7k
Forks
82
Avg merge
1d 22m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/gh-stack

All issues in github/gh-stack

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.