Repository navigation
fix(core): parse local diffs and repository URLs independently of git config and host - #412
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
parse
force-pushed
the
fix/git-and-repo-url-parsing
branch
from
November 17, 2026 17:49
9e9c450 to
7015d62
Compare
parse
marked this pull request as ready for review
November 17, 2026 17:49
[High impact] This PR appears safe to merge. SummaryThis PR brings repository URL parsing into one place and makes local Git diffs more reliable across user settings and unusual filenames.
No new actionable issues found. Reviews (5) · Last reviewed commit: "fix(core): pick the platform API from th..." · Reviewed by Greptile |
parse
force-pushed
the
fix/git-and-repo-url-parsing
branch
from
November 17, 2026 18:09
7015d62 to
6319a26
Compare
parse
force-pushed
the
fix/git-and-repo-url-parsing
branch
from
November 18, 2026 07:16
b924c41 to
4ff5d84
Compare
parse
force-pushed
the
fix/git-and-repo-url-parsing
branch
2 times, most recently
from
November 18, 2026 07:22
fa9271a to
2c7656b
Compare
… config and host - Local git diffs run with fixed prefixes, no color, no external diff, core.quotePath=false and LC_ALL=C; file list and stats come from --name-status -z and --numstat -z - One shared repo locator replaces six parsers for remotes, model links, model repos and PR/MR URLs, including ssh with port, git://, scp form, GitLab nested groups, Azure DevOps and Bitbucket Server paths - Self-hosted GitHub, GitLab and Bitbucket base URLs (with context paths) are honoured; GitHub Enterprise passes its base URL to Octokit - Model repo tokens are only sent over https - ADR-013
- Send a platform token to a model repository only when its host, port and base path match the configured instance for that token (ERODE_*_BASE_URL), or the public host when none is configured. A path shape such as /scm/KEY/repo no longer decides on its own that a token is sent. - Decode C-quoted git paths as one UTF-8 byte buffer, encoding literal characters by code point, so names like src/😀".ts survive. - Decode quoted diff headers before matching prefixes, so quoted no-prefix and mnemonic-prefix headers resolve to the real path.
A public PR URL was fetched from the configured self-hosted API, so erode could analyse a same-named repository there and send the instance token. Readers and writers now resolve the endpoint from the URL host: the public host uses the public API without the token, the configured instance uses ERODE_*_BASE_URL with its token, and any other host is rejected naming the host and the setting. Applies to GitHub, GitLab and Bitbucket.
parse
force-pushed
the
fix/git-and-repo-url-parsing
branch
from
November 18, 2026 07:24
2c7656b to
cfe6569
Compare
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.
Stacked on #411.
What changed
utils/git-diff.ts, newdiff-sections.ts): git runs with-c core.quotePath=false,--no-color,--no-ext-diff,--src-prefix=a/ --dst-prefix=b/andLC_ALL=C. File list and stats come from--name-status -zand--numstat -z.diff.noprefix,diff.mnemonicPrefix, a non-English locale, non-ASCII paths, paths containingb/, renames, type changes and binary files no longer break parsing.utils/repo-locator.ts): replaces six parsers (git-diff remotes,url-utils, model-source, the three PR readers, platform detection, the CLI schema). Handles https/http,ssh://with port,git+ssh,git://, scp form,owner/repo,www.,host:port/path, GitLab nested groups and/-/suffixes, Azure DevOps and Bitbucket Server paths. Credentials are never copied into its output.ERODE_GITHUB_BASE_URL,ERODE_GITLAB_BASE_URLandERODE_BITBUCKET_BASE_URLhosts, including context paths such ashttps://host/gitlab, are recognised for model links, remotes and PR/MR URLs. GitHub Enterprise now passes its base URL to Octokit.platforms/change-request-url.ts): parsed withURL; the marker must follow the repo path directly;/files,/diffs, query and fragment are accepted.git://are cloned as given..git.gitand/-/tree/...slug bugs are fixed.ERODE_*_BASE_URLsettings.Behaviour changes
https://github.com/org) no longer count as repository links, soerode validatemay report those components as unlinked.http://is cloned without a token and fails to authenticate (a warning explains why).changed(type change) orunmerged;filesChangedcounts numstat entries.Review follow-ups
ERODE_*_BASE_URLand its token; github.com, gitlab.com and bitbucket.org use the public API without the instance token; other hosts are rejected with a message naming the setting. Before, a public github.com PR URL was fetched from a configured GitHub Enterprise server.Checks
check:ci