Comments (17)
How come your remote includes ssh://
? It should work without it and GitLab doesn't add it by default.
Although you're right about the port, I'll have to update the regex for that, I didn't consider it when I wrote it ✌️
from hyper-statusline.
@henrikdahl That's true — I'm not sure how I'd recommend fixing it then. I'll try changing my GitLab port to 22 for now! 👍
Thanks for dealing with the issue!
from hyper-statusline.
@hugomd could you elaborate? ✌️
from hyper-statusline.
@henrikdahl If I cd
into a git repository, the bottom right hand corner gives a link to the branch I'm on:
This works fine if I've cloned using HTTPS, and opens my browser and takes me to the repository. If I've cloned using SSH then it opens a new terminal window rather than opening the browser.
from hyper-statusline.
@hugomd are you saying it currently opens a new terminal window when you've cloned with SSH or that it's the expected behavior you'd like to see?
from hyper-statusline.
@henrikdahl It opens a new terminal window when I've cloned with SSH and click on master
, but it would be great if it could open the repository in the default browser — not sure if that's feasible or not though.
from hyper-statusline.
@hugomd mind sharing how your remote url looks?
from hyper-statusline.
It should already do what you're suggesting, which is why it would be useful to see what your remote url looks like. I'm closing this for now ✌️
from hyper-statusline.
@henrikdahl Totally missed this, sorry! It seems to work for GitHub, but not GitLab — I'll look into it myself and see if I can work it out myself and maybe make a PR.
from hyper-statusline.
@henrikdahl Found it. Issue is caused by L167.
If the git remote uses any port other than 22 it won't work. E.g.
> remote = "ssh://[email protected]:1022/hugo/dotfiles.git";
'ssh://[email protected]:1022/hugo/myrepo.git'
> curRemote = remote.trim().replace(/^git@(.*?):/, 'https://$1/').replace(/[A-z0-9\-]+@/, '').replace(/\.git$/, '');
'ssh://my.hosted.git:1022/hugo/myrepo'
Expected output should be:
https://my.hosted.git/hugo/myrepo
Output causing issue is currently:
ssh://my.hosted.git:1022/hugo/myrepo
from hyper-statusline.
I'm running a self-hosted instance of GitLab, which uses a different port. When you do that, GitLab pops ssh:// in front of it.
from hyper-statusline.
So I'm not sure how to solve this. ssh://
part is easy since the regex can simply check for any character before the @
symbol instead of specifically git
.
However the port part is identical to the username part.
ssh://[email protected]:1022/hugo/myrepo.git
[email protected]:henrikdahl/hyper-statusline.git
Since a username can be numbers as well, there's really no way to identify which it is. Any suggestion for a pattern thats consistent? ✌️
from hyper-statusline.
You could check to see if it starts with ssh://
, and if it does then remove what's immediately after the ssh://[email protected]:
There might be a simpler way though
from hyper-statusline.
Someone could have ssh://
even though they don't have a port, it would mess up their URLs so it's not fully reliable.
from hyper-statusline.
@henrikdahl Is the port always followed by a /
? If so you could regex select a number followed by a /
, while still allowing the previous usage.
from hyper-statusline.
@hugomd Problem is that a username could be numbers and follow the exact same pattern.
from hyper-statusline.
@henrikdahl I understand that but /
isn't allowed in usernames, and separates the two.
from hyper-statusline.
Related Issues (20)
- Nothing displayed on Windows with Cygwin HOT 3
- Windows 10 Blank Status Line HOT 9
- Feature Request: git dirty indicator for new but untracked files HOT 1
- Git indicators do not update unless one more command is issued (similar to the previous directory update bug)
- The plugin breaks window-snapping for Hyper on Windows 10 HOT 1
- Would love to contribute to this project but I'm confused by the PID usage HOT 4
- Git status not working
- Adjust opacity or contrast for current working directory HOT 2
- Not playing nice with other plugins
- Not Working With Tmux
- Can not install this plugin in Hyper 3.0.0-canary.8 (canary) HOT 1
- dir path not working with powershell on windows 10 HOT 1
- Git information not showing HOT 3
- Causes Hyper to hang when running ts-lint
- statusline not working with fish HOT 6
- japanese dir name is displayed unicode characters HOT 2
- Failed to load with hyperpower
- hyper-statusline causes significant lag in Hyper v3.1.0 HOT 3
- Allow controlling the text size and position of the status line
- Hi, just curious if this plugin has the ability to change the background color? Thanks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyper-statusline.