Coder Social home page Coder Social logo

Comments (9)

Sertion avatar Sertion commented on September 26, 2024 1

We could possibly add a new token that would be the last part of the URL (sans .git). Other than that I can't see where the project could come from.

Would that be helpful for Gitweb users? In this case there would be two tokens for gitblame.commitUrl:

  • hash - The active line's blame commit's hash
  • project-name - The last section of the origin url (MyProject from ssh://andrew@stamos:29418/MyProject)

I will look into building this. The port will still be weird. It is not possible to guess the port.

from vscode-gitblame.

aeisenberg avatar aeisenberg commented on September 26, 2024 1

I think that would work. Thanks. In my case (as I think is standard with gitweb) is that only the project name and hash changes when specifying a url. The url looks something like this:

https://gerrit.ganchrow.com:8080/gitweb?p=<PROJECT>.git;a=commit;h=<HASH>

So, if you provide the project and hash tokens, the correct url can be generated from the commitUrl setting.

from vscode-gitblame.

aeisenberg avatar aeisenberg commented on September 26, 2024 1

Woohoo! It works. Thanks for adding this feature.

from vscode-gitblame.

Sertion avatar Sertion commented on September 26, 2024

Hello Andrew!

Thank you for the issue and output log!

What does git output when you run git ls-remote --get-url originin /path/to/your/project? If it starts with ssh://git@, git@, or https:// the extension should try to open that URL using commands.executeCommand("vscode.open", commitOriginUrl);[1][2] beyond that it is up to Vscode to know how to parse the URL. It could be that your origin does not match the pattern of a normal URL.

Is your git repository self hosted or are you using an online service?


[1]: Documentation for commands.executeCommand
[2]: Documentation for vscode.open

from vscode-gitblame.

aeisenberg avatar aeisenberg commented on September 26, 2024

Right...it isn't a normal url. We self-host and use urls like this:

ssh://andrew@stamos:29418/MyProject

I could optionally add an different remote with a more normal looking url, but it would be read-only. Does your extension support using a custom remote?

...and...it looks like you the extension supports the gitblame.commitUrl command. So, let me try that.

from vscode-gitblame.

aeisenberg avatar aeisenberg commented on September 26, 2024

OK. This is working...mostly. I'm able to configure the commit URL so that it is correct for a single project.

There is still a problem, though. We are using gitweb as the viewer. Here is what a URL looks like:

https://stamos:8080/gitweb?p=MyProject.git;a=commit;h=${hash}

Notice that the project name is part of the URL. As far as I can tell, there is no way of using a variable for the project name. Do you have any ideas?

from vscode-gitblame.

Sertion avatar Sertion commented on September 26, 2024

Have started on a new version in #46 and will try to find time for a new release this weekend.

from vscode-gitblame.

Sertion avatar Sertion commented on September 26, 2024

A new version has been released. It might take a day or two before it appears for update in your editor. Please confirm if it solves the issue.

from vscode-gitblame.

aeisenberg avatar aeisenberg commented on September 26, 2024

from vscode-gitblame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.