fix(repo-mode): reuse canonical cached project slug (#2212) - #2218
Merged
Conversation
gstack-repo-mode was re-deriving slugs from origin and writing twin project dirs; consume gstack-slug's cached sanitized slug instead.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
time-attack
force-pushed
the
plan-daily-gstack-pr
branch
2 times, most recently
from
July 10, 2026 14:51
009703a to
8aab6df
Compare
Contributor
Author
|
Unsubscribe
…On Tue, Jul 14, 2026, 4:36 PM Joshua France ***@***.***> wrote:
Merged #2218 <#2218> into main.
—
Reply to this email directly, view it on GitHub
<#2218?email_source=notifications&email_token=BQ7R3F3R7LDU3DSFHVWVAEL5E27ZNA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTENZZHA4TKMZYHAYTDJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#event-27989538811>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BQ7R3F6AY7C4SZQIOT3ATUL5E27ZNAVCNFSNUABGKJSXA33TNF2G64TZHMYTCNZZGI3DIMRVHE5US43TOVSTWNBYGU3DANRVGU4DLILWAI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gstack caches a project’s slug from the first time it’s seen (often the local folder name). If you add a GitHub origin later, gstack-repo-mode used to ignore that cache and invent a new slug from the remote URL. That wrote state into a second “twin” project folder, so history could look split or lost and you’d get duplicate untracked project dirs.
This fix makes gstack-repo-mode reuse the canonical cached slug from gstack-slug. Repos with no remote still return REPO_MODE=unknown. It runs from the git root so the PWD-keyed cache matches.
Fixes #2212
Tests
We built local Git workspaces that mimic real public repos people use with gstack, reproduced the twin-slug bug in each, then verified the fix:
react-local-history, cache slug first, then addhttps://github.com/facebook/react.gitas origin. Before: wrote underfacebook-react. After: keepsreact-local-historyand no twin dir.next-local-history→https://github.com/vercel/next.js.git.kubernetes-local-history→https://github.com/kubernetes/kubernetes.git.Additional coverage:
REPO_MODE=unknownand creates no project dirAll 6 cases in
test/gstack-repo-mode.test.tspass viabun test test/gstack-repo-mode.test.ts.