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

Get Repository Url (tested:gitlab) Unexpected behavior #278

Closed
lobster2012-user opened this issue May 9, 2019 · 5 comments
Closed

Get Repository Url (tested:gitlab) Unexpected behavior #278

lobster2012-user opened this issue May 9, 2019 · 5 comments

Comments

@lobster2012-user
Copy link

lobster2012-user commented May 9, 2019

Hi!
Domain1=gitlab.com
1.
Repository Url= https://domain1/....
Origin repo url = git@domain2
Got error - SourceControlInformationIsNotAvailableGeneratedSourceLinkEmpty

Ideally, I want to see that there is no mapping for a specific host.
or get https://domain1/ and see url in output

Repository Url=
Origin repo url = git@domain2
Got source link https://domain2/
Ideally, I want to see that there is no mapping for a specific host.

  1. All ok
    Ideally, I want to see url in output

p.s.
I use separate hosts aliases for different repositories to set keys in .ssh / config (+ vs + git)
Or is there a more elegant way?

What do you think about it?

@lobster2012-user lobster2012-user changed the title Get Repository Url (gitlab) Get Repository Url (tested:gitlab) Unexpected behavior May 9, 2019
@tmat
Copy link
Member

tmat commented May 10, 2019

I'm not sure I understand the issue. Can you share the sections of the repository configuration that specify the remotes? Do you specify url sections in your repo configuration file (or any other relevant git config)?

@lobster2012-user
Copy link
Author

lobster2012-user commented May 10, 2019

Repository URL is setting of project.(VS ui and .csproj)
Origin repo URL is setting of. git

Domain1=gitlab.com

+aliases in. Ssh config
Domain 2
Hostname gitlab.com

Did I answer your question?

@tmat
Copy link
Member

tmat commented May 10, 2019

You shouldn't need to set RepositoryUrl property in the project. It's automatically initialized from the origin remote URL by SourceLink if you set PublishRepositoryUrl. RepositoryUrl also has nothing to do with the URL in the generated SourceLink.json file. It's only used for NuGet packages.

Source Link currently doesn't resolve aliases in ssh config. It uses the remote URL specified in git config as is.

@lobster2012-user
Copy link
Author

lobster2012-user commented May 11, 2019

In general, everything is clear.
As I wrote above, for some reason, the behavior depends on the assignment of the repository url.
I would like to see a detailed error and success report for a specific host anyway.

For discussion.

  1. Having set the repository url, I assume that this is the link to the code (instead of the settings in .git)

  2. Reading of .ssh/config. That would be the perfect solution. You can, of course, read .ssh / config via source link.
    This eliminates the need to prescribe anything.
    I do not know, it would fit all
    can be enabled by setting true / false

@lobster2012-user
Copy link
Author

It is most likely possible to do separate tasks. In the process...

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

2 participants