question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repository URL not appearing because "git@" or "http(s)" is hardcoded in matching logic

See original GitHub issue

If the repository URL isn’t formatted to a very hardcoded format, the “View repository” button won’t appear.

The issue is around here in utils.ts:


		const matched =
			/^(?:git@|https?:\/\/)(?<provider>[a-zA-Z_.~-]+\.[a-z]{2,})(?::|\/)(?<user>.*?)\/(?<repo>.*)$/.exec(
				remoteUrl.stdout.trim()
			);

It is not always applicable that the SSH user is git, or that the SSH user is specified in the URL on the machine. Namely, you can configure in your SSH config:

Host mygithost.com
   HostName mygithost.com
   User gitolite
   Port 4022

and then use mygithost.com:user/repo (or /repo.git) in the config of the local repository.

It is still highly likely that http://mygithost.com/user/repo is still valid in this context and leads to the repository.

Alternatively, a config option (on a per-repo level) where you could specify which URL to open, side-stepping the entire problem.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
whisperitycommented, Aug 26, 2021

Alright, can confirm it works now properly! (As in, sans the Discord bug.) Hang on! This link will take you to . Are you sure you want to go there?

1reaction
whisperitycommented, Aug 21, 2021

I’ve found this library, written in pure JavaScript: https://github.com/IonicaBizau/git-url-parse. Perhaps you could use this to parse all the components of the remote URL in a portable way, and use the resulting struct to build the URL sent to Discord.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github repository code is not matching live website
I've pushed changes to my html file to change a URL, but the changes are not showing up on the live website. I...
Read more >
Protect and discover secrets using Gitleaks - GitHub
Gitleaks is a SAST tool for detecting and preventing hardcoded secrets like ... repos: - repo: https://github.com/zricethezav/gitleaks rev: v8.12.0 hooks: ...
Read more >
Updating to Git 1.8.1 - Wincent
When "git push [$there]" does not say what to push, we have used the traditional "matching" semantics so far (all your branches were...
Read more >
Troubleshooting Geo - GitLab Docs
Ensure the URL field matches the value found in /etc/gitlab/gitlab.rb in external_url "https://gitlab.example.com" on the Rails nodes of the secondary site.
Read more >
Control Freak for Bitbucket Server - Documentation
Enforce Git best practices in all your repositories. ... Author "Admin <admin@bit-booster.com>" does not exactly match remote: a Bitbucket user record.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found