Skip to content
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

Permalink starts with https://null/null if project imported from https git url. #6

Open
vladvershinin opened this issue Feb 9, 2022 · 8 comments

Comments

@vladvershinin
Copy link

Hi!

At some point in time, I've started to get https://null/null/blob/.... links.
Looks like something happens with my repo value as it returns from GitRepositoryManager.getInstance(project).getRepositoryForFileQuick(virtualFile) so repo?.remotes?.first()?.firstUrl doesn't match to the regexp .*(?:@|\\/\\/)(.[^:\\/]*).([^\\.]+)\\.git.

IntelliJ IDEA 2021.2.4 (Ultimate Edition)
Build #IU-212.5712.43, built on December 21, 2021
Licensed to ООО «ЯНДЕКС»

Runtime version: 11.0.13+8-b1504.49 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry: scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins: com.ultrahob.zerolength.plugin2 (0.93), mobi.hsz.idea.gitignore (4.3.0), com.github.kawamataryo.copygithublink (0.3.1), com.vexus2.intellij.openingithub (1.0.6), org.jetbrains.plugins.hocon (2021.1.0), String Manipulation (8.27.203.5981.1), org.jetbrains.kotlin (212-1.6.10-release-923-IJ5457.46), org.intellij.scala (2021.2.30), zio.intellij.zio-intellij (2021.2.14.0), izhangzhihao.rainbow.brackets (6.21), com.google.idea.bazel.ijwb (2022.01.25.0.0-api-version-212), ru.yandex.verts.bazel-zio-test (0.3)
Kotlin: 212-1.6.10-release-923-IJ5457.46

@vladvershinin
Copy link
Author

I see now that I've imported my repository using Idea -> File -> New project from Version Control...
And I used https://github.com/YandexClassifieds/projectname url to import.
That's how git origin doesn't end with .git.

@vladvershinin vladvershinin changed the title Permalink starts with https://null/null Permalink starts with https://null/null if project imported from https:// git url. Feb 9, 2022
@vladvershinin vladvershinin changed the title Permalink starts with https://null/null if project imported from https:// git url. Permalink starts with https://null/null if project imported from https git url. Feb 9, 2022
@vladvershinin
Copy link
Author

I see now that I've imported my repository using Idea -> File -> New project from Version Control... And I used https://github.com/YandexClassifieds/projectname url to import. That's how git origin doesn't end with .git.

So, switch to [email protected]:YandexClassifieds/projectname.git help as workaround.
But at least an indication would be appreciated in such situation for future users.

@PRGfx
Copy link

PRGfx commented Apr 26, 2022

While the .git is a problem, in my case the regex also fails for URLs with a . in the path, e.g. user/namespace.package.
Some of the supported URL formats don't come from sources I expect this plugin to link to, but the current regex looks a bit too restrictive to me.

(btw .git is also optional for ssh remote URLs)

@kawamataryo
Copy link
Owner

Sorry for the delay in replying.
I understand the problem. I will try to fix the regular expression.

@flakey-bit
Copy link

Hey @kawamataryo any update on this?

Having trouble with URLs like

  • [email protected]:MyArea/MyCompany.MyRepository.MyProduct.git
  • https://github.dev.my-company.com/MyArea/MyCompany.MyRepository.MyProduct.git

End up with https://null/null/blob/8a14b7c598c2e654cc52b40b8d22ba15324b6761/...

@kawamataryo
Copy link
Owner

Sorry for the delayed response. I plan to rectify this issue soon.

@kawamataryo kawamataryo mentioned this issue May 9, 2023
@kawamataryo
Copy link
Owner

I fixed it to work with URLs that don't have .git, However, it still does not work with URLs containing namespace.

@dustinblue
Copy link

I also get null with latest PHP Storm and plugin. I clone my repo with ssh and then open the directory in PHP Storm to start the project.

https://nullnull/null/blob/c4d8a5b99e35a340f821b378d68229e588f0ed96...

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

No branches or pull requests

5 participants