Sfoglia il codice sorgente

Enhances PR#192

main
Eric Amodio 7 anni fa
parent
commit
c1d4fcd518
12 ha cambiato i file con 32 aggiunte e 17 eliminazioni
  1. +1
    -0
      CHANGELOG.md
  2. +2
    -1
      README.md
  3. +5
    -0
      package.json
  4. +1
    -0
      src/configuration.ts
  5. +2
    -1
      src/git/remotes/bitbucket-server.ts
  6. +2
    -1
      src/git/remotes/bitbucket.ts
  7. +6
    -4
      src/git/remotes/custom.ts
  8. +5
    -5
      src/git/remotes/factory.ts
  9. +2
    -1
      src/git/remotes/github.ts
  10. +2
    -1
      src/git/remotes/gitlab.ts
  11. +2
    -2
      src/git/remotes/provider.ts
  12. +2
    -1
      src/git/remotes/visualStudio.ts

+ 1
- 0
CHANGELOG.md Vedi File

@ -28,6 +28,7 @@ ATTENTION! To support multi-root workspaces some underlying fundamentals had to
- Adds `Rebase Branch to Remote (via Terminal)` command (`gitlens.terminalRebaseBranchToRemote`) to branch node(s) of the `GitLens` custom view
- Adds `Rebase Commit (via Terminal)` command (`gitlens.terminalRebaseCommit`) to commit node(s) of the `GitLens` custom view
- Adds `Reset Commit (via Terminal)` command (`gitlens.terminalResetCommit`) to commit node(s) of the `GitLens` custom view
- Adds ability to specify the url protocol used with user-defined remote services via `gitlens.remotes` setting -- thanks to [PR #192](https://github.com/eamodio/vscode-gitlens/pull/192) by Helmut Januschka ([@hjanuschka](https://github.com/hjanuschka))!
### Changed
- `GitLens` custom view will no longer show if there is no Git repository -- closes [#159](https://github.com/eamodio/vscode-gitlens/issues/159)

+ 2
- 1
README.md Vedi File

@ -398,7 +398,7 @@ GitLens is highly customizable and provides many configuration settings to allow
|Name | Description
|-----|------------
|`gitlens.remotes`|Specifies user-defined remote (code-hosting) services or custom domains for built-in remote services<br /><br />Example:<br />```"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "GitHub" }]```<br /><br />Example:<br />```"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "Custom", "name": "My Company", "urls": { "repository": "https://git.corporate-url.com/${repo}", "branches": "https://git.corporate-url.com/${repo}/branches", "branch": "https://git.corporate-url.com/${repo}/commits/${branch}", "commit": "https://git.corporate-url.com/${repo}/commit/${id}", "file": "https://git.corporate-url.com/${repo}?path=${file}${line}", "fileInBranch": "https://git.corporate-url.com/${repo}/blob/${branch}/${file}${line}", "fileInCommit": "https://git.corporate-url.com/${repo}/blob/${id}/${file}${line}", "fileLine": "#L${line}", "fileRange": "#L${start}-L${end}" } }```
|`gitlens.remotes`|Specifies user-defined remote (code-hosting) services or custom domains for built-in remote services<br /><br />Example:<br />```"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "GitHub" }]```<br /><br />Example:<br />```"gitlens.remotes": [{ "domain": "git.corporate-url.com", "type": "Custom", "name": "My Company", "protocol": "https", "urls": { "repository": "https://git.corporate-url.com/${repo}", "branches": "https://git.corporate-url.com/${repo}/branches", "branch": "https://git.corporate-url.com/${repo}/commits/${branch}", "commit": "https://git.corporate-url.com/${repo}/commit/${id}", "file": "https://git.corporate-url.com/${repo}?path=${file}${line}", "fileInBranch": "https://git.corporate-url.com/${repo}/blob/${branch}/${file}${line}", "fileInCommit": "https://git.corporate-url.com/${repo}/blob/${id}/${file}${line}", "fileLine": "#L${line}", "fileRange": "#L${start}-L${end}" } }```
### Status Bar Settings
@ -459,6 +459,7 @@ GitLens is highly customizable and provides many configuration settings to allow
A big thanks to the people that have contributed to this project:
- Amanda Cameron ([@AmandaCameron](https://github.com/AmandaCameron)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=AmandaCameron))
- Helmut Januschka ([@hjanuschka](https://github.com/hjanuschka)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=hjanuschka))
- Chris Kaczor ([@ckaczor](https://github.com/ckaczor)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=ckaczor))
- Peng Lyu ([@rebornix](https://github.com/rebornix)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=rebornix))
- Aurelio Ogliari ([@nobitagit](https://github.com/nobitagit)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=nobitagit)

+ 5
- 0
package.json Vedi File

@ -575,6 +575,11 @@
"type": "string",
"description": "Specifies an optional friendly name for the custom remote service"
},
"protocol": {
"type": "string",
"default": "https",
"description": "Specifies an optional url protocol for the custom remote service"
},
"urls": {
"type": "object",
"required": [

+ 1
- 0
src/configuration.ts Vedi File

@ -143,6 +143,7 @@ export interface IRemotesConfig {
type: CustomRemoteType;
domain: string;
name?: string;
protocol?: string;
urls?: IRemotesUrlsConfig;
}

+ 2
- 1
src/git/remotes/bitbucket-server.ts Vedi File

@ -7,10 +7,11 @@ export class BitbucketServerService extends RemoteProvider {
constructor(
domain: string,
path: string,
protocol?: string,
name?: string,
custom: boolean = false
) {
super(domain, path, name, custom);
super(domain, path, protocol, name, custom);
}
get name() {

+ 2
- 1
src/git/remotes/bitbucket.ts Vedi File

@ -7,10 +7,11 @@ export class BitbucketService extends RemoteProvider {
constructor(
domain: string,
path: string,
protocol?: string,
name?: string,
custom: boolean = false
) {
super(domain, path, name, custom);
super(domain, path, protocol, name, custom);
}
get name() {

+ 6
- 4
src/git/remotes/custom.ts Vedi File

@ -1,7 +1,7 @@
'use strict';
import { Strings } from '../../system';
import { Range } from 'vscode';
import { IRemotesConfig, IRemotesUrlsConfig } from '../../configuration';
import { IRemotesUrlsConfig } from '../../configuration';
import { RemoteProvider } from './provider';
export class CustomService extends RemoteProvider {
@ -11,10 +11,12 @@ export class CustomService extends RemoteProvider {
constructor(
domain: string,
path: string,
config: IRemotesConfig
urls: IRemotesUrlsConfig,
protocol?: string,
name?: string
) {
super(domain, path, config.name, true);
this.urls = config.urls!;
super(domain, path, protocol, name, true);
this.urls = urls;
}
get name() {

+ 5
- 5
src/git/remotes/factory.ts Vedi File

@ -59,11 +59,11 @@ export class RemoteProviderFactory {
private static getCustomProvider(cfg: IRemotesConfig) {
switch (cfg.type) {
case CustomRemoteType.Bitbucket: return (domain: string, path: string) => new BitbucketService(domain, path, cfg.name, true);
case CustomRemoteType.BitbucketServer: return (domain: string, path: string) => new BitbucketServerService(domain, path, cfg.name, true);
case CustomRemoteType.Custom: return (domain: string, path: string) => new CustomService(domain, path, cfg);
case CustomRemoteType.GitHub: return (domain: string, path: string) => new GitHubService(domain, path, cfg.name, true);
case CustomRemoteType.GitLab: return (domain: string, path: string) => new GitLabService(domain, path, cfg.name, true);
case CustomRemoteType.Bitbucket: return (domain: string, path: string) => new BitbucketService(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.BitbucketServer: return (domain: string, path: string) => new BitbucketServerService(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.Custom: return (domain: string, path: string) => new CustomService(domain, path, cfg.urls!, cfg.protocol, cfg.name);
case CustomRemoteType.GitHub: return (domain: string, path: string) => new GitHubService(domain, path, cfg.protocol, cfg.name, true);
case CustomRemoteType.GitLab: return (domain: string, path: string) => new GitLabService(domain, path, cfg.protocol, cfg.name, true);
}
return undefined;
}

+ 2
- 1
src/git/remotes/github.ts Vedi File

@ -7,10 +7,11 @@ export class GitHubService extends RemoteProvider {
constructor(
domain: string,
path: string,
protocol?: string,
name?: string,
custom: boolean = false
) {
super(domain, path, name, custom);
super(domain, path, protocol, name, custom);
}
get name() {

+ 2
- 1
src/git/remotes/gitlab.ts Vedi File

@ -7,10 +7,11 @@ export class GitLabService extends RemoteProvider {
constructor(
domain: string,
path: string,
protocol?: string,
name?: string,
custom: boolean = false
) {
super(domain, path, name, custom);
super(domain, path, protocol, name, custom);
}
get name() {

+ 2
- 2
src/git/remotes/provider.ts Vedi File

@ -39,8 +39,8 @@ export abstract class RemoteProvider {
constructor(
public readonly domain: string,
public readonly path: string,
private readonly protocol: string = 'https',
name?: string,
public readonly protocol: string = 'https'
public readonly custom: boolean = false
) {
this._name = name;
@ -49,7 +49,7 @@ export abstract class RemoteProvider {
abstract get name(): string;
protected get baseUrl() {
return `${this.protocol}://${this.domain}/${this.path}`;
return `${this.protocol}://${this.domain}/${this.path}`;
}
protected formatName(name: string) {

+ 2
- 1
src/git/remotes/visualStudio.ts Vedi File

@ -7,9 +7,10 @@ export class VisualStudioService extends RemoteProvider {
constructor(
domain: string,
path: string,
protocol?: string,
name?: string
) {
super(domain, path, name);
super(domain, path, protocol, name);
}
get name() {

Caricamento…
Annulla
Salva