Skip to content

fix: normalize ssh URL remotes in global discovery#976

Open
officialasishkumar wants to merge 1 commit intogarrytan:mainfrom
officialasishkumar:fix/global-discover-ssh-url-normalization
Open

fix: normalize ssh URL remotes in global discovery#976
officialasishkumar wants to merge 1 commit intogarrytan:mainfrom
officialasishkumar:fix/global-discover-ssh-url-normalization

Conversation

@officialasishkumar
Copy link
Copy Markdown

Summary

  • Normalize ssh://git@host/owner/repo.git remotes to the same HTTPS canonical form as scp-style SSH remotes
  • Keep existing scp-style SSH normalization behavior intact
  • Add regression coverage for GitHub and GitLab URL-style SSH remotes, plus cross-format deduplication

Fixes #975

Testing

  • PATH=/tmp/gstack-bun/node_modules/.bin:$PATH bun test test/global-discover.test.ts
  • PATH=/tmp/gstack-bun/node_modules/.bin:$PATH bun -e "import { normalizeRemoteUrl } from './bin/gstack-global-discover.ts'; console.log(normalizeRemoteUrl('git@github.com:garrytan/gstack.git')); console.log(normalizeRemoteUrl('ssh://git@github.com/garrytan/gstack.git')); console.log(normalizeRemoteUrl('https://github.com/garrytan/gstack.git'));"

Handle URL-style SSH git remotes such as ssh://git@github.com/owner/repo.git in the same canonicalization path as scp-style SSH remotes. This prevents global discovery consumers from reporting duplicate repos when different tools or clones use equivalent SSH remote formats.

Add regression coverage for GitHub and GitLab URL-style SSH remotes and for deduping SSH URL, scp-style SSH, and HTTPS forms together.

Fixes garrytan#975
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.

gstack-global-discover does not dedupe ssh:// git remotes

1 participant