Comments (6)
I don't think it is possible, since in standard flow (from editor to ui) we can call git
commands to retrieve required information. In reverse flow information is not enough to locate file or even branch.
from browse-at-remote.
What do you mean? All the information is there, the file is at git checkout 1a9392e9d1fad4e1aafb25b68b4e6857fde8f564
(or there could be a branch name in that part of the URL, git checkout should just work) and the absolute file path is $(git rev-parse --show-toplevel)/browse-at-remote.el
on line 39.
from browse-at-remote.
Can you please explain how git root path can be found from URL in clipboard?
from browse-at-remote.
Can you get the directory of the buffer where the "inverse browse-at-remote" command was called and then you do git rev-parse --show-toplevel
in that directory and append everything after the blob name to it to get the path?
from browse-at-remote.
@verhovsky How to get right location of git root folder?
from browse-at-remote.
You can't get it from the URL. You would get it from the location of the buffer I have open in Emacs when I run the inverse command. Just as you do now for the regular browse-at-remote
commands.
If I have repositories a
and b
and I try to open a URL that is from a remote of repo a
while I'm looking at a file in repo b
, then you'll get the root location of repo b
, extract the relative path from the url and then try to look up a file path that doesn't exist (it might exist by coincidence sometimes) and show me an error message like "This file doesn't exist. You might've opened a link from the wrong repo: {link I tried to open}". This would also happen if the file was created on the remote but I don't have it (just as I get 404 errors now if I try to browse-at-remote
a file that the remote doesn't have, or try to look at a file that was deleted on the remote).
Additionally, if the remote url I'm trying to open doesn't exist in the .git/config
file of the repo that I'm running the command from, you can guess that I'm probably running the command from the wrong repo. But that's not necessarily the case, I might just not have a remote configured as a remote, so this check isn't really necessary. Could just help you improve the error message.
from browse-at-remote.
Related Issues (20)
- Add the variable of git.exe path on windows when someone use portable git-for-windows HOT 1
- Private bitbucket repos are not supported HOT 3
- How to select or change remote HOT 3
- Release version HOT 1
- browse-remote-prefer-symbolic does not fallback to git revision in detached HEAD state
- Line numbers in URL even though I didn't select any line HOT 3
- Tag version 0.14.0 HOT 2
- support SSH session HOT 1
- `apply: Wrong number of arguments: #<subr cons>, 1` when tracking local branches HOT 1
- Allow more customization of domain based on remote HOT 13
- Feature request: support Gogs and/or Gitea
- prefer-symbolic nil causes 404 in bitbucket
- Wrong remote selected
- Can't browse at remove after the package update HOT 2
- Can't browse custom domain even with set browse-at-remote-remote-type-domains HOT 4
- refs%2Fheads%2F is added to URL for type stash, resulting in broken link
- open with gitlab without starting with `https://`
- Unsure what remote type should be used for heroku
- browse-at-remote opens heroku when it should open github
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 browse-at-remote.