-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitbucket Server remote - "scm/" path prefix not removed, possible regression from #767? #3218
Comments
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Hi, I've been having issues getting my Bitbucket Server remote setup with the most recent version of GitLens. After searching through related issues in the issue tracker, what I could best describe is that I've been experiencing a combination of #267 and #692.
My remote URL look something like this:
https://domain/scm/web/someRepo.git
, assuming project name is "web" and repo name is "someRepo". From what I understand, the original fix for #267 would work if my URL looked like:https://domain/web/someRepo.git
. However, because I have "scm/" prefix as well, this ends up turningrepoBase
intoscm
instead ofweb
, andrepoPath
becomesweb/someRepo
instead ofsomeRepo
.From what I gather, PR #767 (722a7d2) originally fixed this issue for Bitbucket Server URLs, by providing a special case for this
scm/
prefix. However, I noticed in the following change from 5 months ago (ba0a6c8#diff-3df44eca214dcc6e95c893331e04e784c958b3167e664a01dd724acb68cdefefR54), the "scm/" handling was moved into a newsplitPath
override method, but the part that does the actual splitting splits the original path instead of the modified path (without the "scm/"), which is not what the previous version did. This I believe is causing the "scm/" to still appear in transformed Bitbucket Server URLs, and also any project name over 3 characters long is also mangled because of this. I have more details in my Reproduction Steps below.I already have a fix for this here: Coteh@0ba49ab
I will put up a PR for this shortly if that's ok?
Reproduction Steps
If you need them, here are some reproduction steps that you can do to replicate the issue on your end. (I guess you'll need a Bitbucket Server as well to test, or something that mimics it)
projects/web/repos/someRepo
. Instead it ends up beingprojects/scm/repos/web/someRepo
.This is further exacerbated when a project name is more than 3 characters long. The index that
splitPath
method inside bitbucket-server uses when splitting is going off of the new transformedpath
withoutscm/
prefix, but it's being applied to the original path withscm/
prefix in it. This will cause project names to have a slash and other extra characters and the repo name to be cut off. For example, if my project name was "tests", the transformed path would contain something likeprojects/scm/t/repos/sts/someRepo
, the "e" would be cut off because that's where the index was in the transformed path "tests/someRepo".GitLens Version
v14.9.0
VS Code Version
Version: 1.87.2 (Universal)
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:21:31.043Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.2.0
Git Version
git version 2.44.0
Logs, Screenshots, Screen Captures, etc
No response
The text was updated successfully, but these errors were encountered: