Skip to content

feat!: add 'gra fetch', remove 'gra clean' and 'gra migrate' - #26

Merged
martinus merged 1 commit into
mainfrom
feat-gra-fetch
Jul 29, 2026
Merged

martinus merged 1 commit into
mainfrom
feat-gra-fetch

Conversation

@martinus

Copy link
Copy Markdown
Owner

Fetching was hidden inside gra clean, so the one command that went to the network was the one about removing worktrees, while gra ls — whose SYNC column the fetch is for — stayed offline with no way to refresh it.

gra fetch (new)

Runs git fetch --prune --all in every repository under the gra root, several at a time:

Fetching 14 repositories
fetched 14 repositories
  • Every remote, not just origin: a fork's upstream is exactly the remote that goes stale.
  • Only remote-tracking refs move — no worktree, branch, or uncommitted change is touched.
  • A repository that cannot be reached is named with git's reason and the others are still fetched (fetched 13 of 14 repositories).
  • gra ls --fetch fetches first and then prints the table, so SYNC is current.

gra clean removed

gra done removes a worktree with the same merged / patch-equivalent checks, one at a time and where you are standing. That takes the .grakeep keep marker with it — nothing reads it any more, so it is no longer written to the local exclude file. Existing repositories keep the now-inert exclude line; an existing .grakeep file will start showing up as untracked.

gra migrate removed

It renamed worktrees named by gra 1.x–3.x, which have all been renamed by now. The dead is_generated_name/WORD_LENGTH helpers go with it.

Net: -373 lines. Five new tests cover fetch + prune across repositories, the second remote, an unreachable repository not costing the others their fetch, the empty root, and ls --fetch refreshing SYNC.

🤖 Generated with Claude Code

Fetching was hidden inside 'gra clean', so the one command that went to the
network was the one about removing worktrees, while 'gra ls' - the command
whose SYNC column the fetch is for - stayed offline with no way to refresh it.

'gra fetch' runs 'git fetch --prune --all' in every repository under the gra
root, several at a time, and 'gra ls --fetch' does that first and then prints
the table. Every remote rather than just origin: a fork's 'upstream' is
exactly the remote that goes stale. A repository that cannot be reached is
named with git's reason and the others are still fetched.

'gra clean' is gone: 'gra done' removes a worktree with the same merged and
patch-equivalent checks, one at a time and where you are standing. That takes
the '.grakeep' keep marker with it - nothing reads it any more, so it is no
longer written to the local exclude file.

'gra migrate' is gone too. It renamed worktrees named by gra 1.x-3.x, which
have all been renamed by now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@martinus
martinus merged commit 3bc2904 into main Jul 29, 2026
2 checks passed
@martinus
martinus deleted the feat-gra-fetch branch July 29, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant