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

OpenHandler and ResourceProvider for git #505

Closed
svenefftinge opened this issue Sep 12, 2017 · 6 comments
Closed

OpenHandler and ResourceProvider for git #505

svenefftinge opened this issue Sep 12, 2017 · 6 comments
Assignees
Milestone

Comments

@svenefftinge
Copy link
Contributor

svenefftinge commented Sep 12, 2017

As part of #165, we need to register an ResourceProvider

That can be used to open editors and provide resource contents for files from specific git revisions.
For the URI I propose the following:

gitrev://repo_name/my/file.tsx#HEAD
\_____/\__________/\__________/\______/
   |         |          |           | 
scheme   repository    path      commitish
@hexa00
Copy link

hexa00 commented Sep 12, 2017

I think handling #HEAD might be tricky since a file can end with #...

Rather then mitigate this maybe we could have:

gitrev://repo_name/commithash/my/file.ts 

Then we always use the same separator...

Github does somthing similar like:

https://github.com/theia/blob/db5745a1089fdbfb73c12ac90165bd70dfe1b2a7/packages/terminal/src/browser/terminal-widget.ts

to view a file

@svenefftinge
Copy link
Contributor Author

Files ending with # will cause problems with URIs in general. It is not limited to this style of uri.
But if we require a gitrev to come with a fragment, it would even work with hashes in file names, as only the last hash is considered (AFAIR)

@svenefftinge
Copy link
Contributor Author

But thinking about it, as the whole repo is available for a certain revision, we could indeed make it the first segment after the repo.

@akosyakov
Copy link
Member

In URI query params are always starts from ?: https://en.wikipedia.org/wiki/Query_string

@akosyakov
Copy link
Member

In the file path ? should be encoded. Our URI takes care about it.

@svenefftinge svenefftinge added this to the Theia 1.0 BETA milestone Sep 21, 2017
@svenefftinge
Copy link
Contributor Author

Fixed with #392

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

4 participants