Bläddra i källkod

Adds dotted notation setting - closes #330

main
Eric Amodio 5 år sedan
förälder
incheckning
834c452d8d
6 ändrade filer med 31 tillägg och 18 borttagningar
  1. +1
    -0
      CHANGELOG.md
  2. +16
    -15
      README.md
  3. +6
    -0
      package.json
  4. +1
    -0
      src/config.ts
  5. +4
    -2
      src/views/nodes/compareBranchNode.ts
  6. +3
    -1
      src/views/nodes/compareResultsNode.ts

+ 1
- 0
CHANGELOG.md Visa fil

@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- A context menu provides access to more common file revision commands
- **\* Files Changed** — lists all of the files changed between the compared revisions
- Adds a `gitlens.views.repositories.showBranchComparison` setting to specify whether to show a comparison of the current branch to a user-selected reference in the _Repositories_ view
- Adds a `gitlens.advanced.useSymmetricDifferenceNotation` setting to specify whether to use the symmetric difference (three-dot) notation or the range (two-dot) notation for comparisions — closes [#330](https://github.com/eamodio/vscode-gitlens/issues/330)
- Adds a _Copy Remote Url to Clipboard_ command to commit quick pick menus
## Changed

+ 16
- 15
README.md Visa fil

@ -858,21 +858,22 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
### Advanced Settings [#](#advanced-settings- 'Advanced Settings')
| Name | Description |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.advanced.abbreviatedShaLength` | Specifies the length of abbreviated commit ids (shas) |
| `gitlens.advanced.blame.customArguments` | Specifies additional arguments to pass to the `git blame` command |
| `gitlens.advanced.blame.delayAfterEdit` | Specifies the time (in milliseconds) to wait before re-blaming an unsaved document after an edit. Use 0 to specify an infinite wait |
| `gitlens.advanced.blame.sizeThresholdAfterEdit` | Specifies the maximum document size (in lines) allowed to be re-blamed after an edit while still unsaved. Use 0 to specify no maximum |
| `gitlens.advanced.caching.enabled` | Specifies whether git output will be cached — changing the default is not recommended |
| `gitlens.advanced.fileHistoryFollowsRenames` | Specifies whether file histories will follow renames -- will affect how merge commits are shown in histories |
| `gitlens.advanced.maxListItems` | Specifies the maximum number of items to show in a list. Use 0 to specify no maximum |
| `gitlens.advanced.maxSearchItems` | Specifies the maximum number of items to show in a search. Use 0 to specify no maximum |
| `gitlens.advanced.messages` | Specifies which messages should be suppressed |
| `gitlens.advanced.quickPick.closeOnFocusOut` | Specifies whether to close QuickPick menus when focus is lost |
| `gitlens.advanced.repositorySearchDepth` | Specifies how many folders deep to search for repositories |
| `gitlens.advanced.similarityThreshold` | Specifies the amount (percent) of similarity a deleted and added file pair must have to be considered a rename |
| `gitlens.advanced.telemetry.enabled` | Specifies whether to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting |
| Name | Description |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.advanced.abbreviatedShaLength` | Specifies the length of abbreviated commit ids (shas) |
| `gitlens.advanced.blame.customArguments` | Specifies additional arguments to pass to the `git blame` command |
| `gitlens.advanced.blame.delayAfterEdit` | Specifies the time (in milliseconds) to wait before re-blaming an unsaved document after an edit. Use 0 to specify an infinite wait |
| `gitlens.advanced.blame.sizeThresholdAfterEdit` | Specifies the maximum document size (in lines) allowed to be re-blamed after an edit while still unsaved. Use 0 to specify no maximum |
| `gitlens.advanced.caching.enabled` | Specifies whether git output will be cached — changing the default is not recommended |
| `gitlens.advanced.fileHistoryFollowsRenames` | Specifies whether file histories will follow renames -- will affect how merge commits are shown in histories |
| `gitlens.advanced.maxListItems` | Specifies the maximum number of items to show in a list. Use 0 to specify no maximum |
| `gitlens.advanced.maxSearchItems` | Specifies the maximum number of items to show in a search. Use 0 to specify no maximum |
| `gitlens.advanced.messages` | Specifies which messages should be suppressed |
| `gitlens.advanced.quickPick.closeOnFocusOut` | Specifies whether to close QuickPick menus when focus is lost |
| `gitlens.advanced.repositorySearchDepth` | Specifies how many folders deep to search for repositories |
| `gitlens.advanced.similarityThreshold` | Specifies the amount (percent) of similarity a deleted and added file pair must have to be considered a rename |
| `gitlens.advanced.telemetry.enabled` | Specifies whether to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting |
| `gitlens.advanced.useSymmetricDifferenceNotation` | Specifies whether to use the symmetric difference (three-dot) notation or the range (two-dot) notation for comparisions. See the [Git docs](https://git-scm.com/docs/gitrevisions#_dotted_range_notations) |
#### Custom Remotes Settings

+ 6
- 0
package.json Visa fil

@ -1752,6 +1752,12 @@
"default": true,
"markdownDescription": "Specifies whether to enable GitLens telemetry (even if enabled still abides by the overall `#telemetry.enableTelemetry#` setting",
"scope": "window"
},
"gitlens.advanced.useSymmetricDifferenceNotation": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to use the symmetric difference (three-dot) notation or the range (two-dot) notation for comparisions. See the [Git docs](https://git-scm.com/docs/gitrevisions#_dotted_range_notations)",
"scope": "window"
}
}
},

+ 1
- 0
src/config.ts Visa fil

@ -224,6 +224,7 @@ export interface AdvancedConfig {
telemetry: {
enabled: boolean;
};
useSymmetricDifferenceNotation: boolean;
}
export interface CodeLensConfig {

+ 4
- 2
src/views/nodes/compareBranchNode.ts Visa fil

@ -44,7 +44,7 @@ export class CompareBranchNode extends ViewNode {
querying: true
}
),
new ResultsFilesNode(this.view, this, this.uri.repoPath!, this.branch.ref, this._compareWith)
new ResultsFilesNode(this.view, this, this.uri.repoPath!, this._compareWith, this.branch.ref)
];
}
return this._children;
@ -102,9 +102,11 @@ export class CompareBranchNode extends ViewNode {
}
private async getCommitsQuery(maxCount: number | undefined): Promise<CommitsQueryResults> {
const notation = Container.config.advanced.useSymmetricDifferenceNotation ? '...' : '..';
const log = await Container.git.getLog(this.uri.repoPath!, {
maxCount: maxCount,
ref: `${this.branch.ref}...${this._compareWith || 'HEAD'}`
ref: `${this._compareWith || 'HEAD'}${notation}${this.branch.ref}`
});
const count = log !== undefined ? log.count : 0;

+ 3
- 1
src/views/nodes/compareResultsNode.ts Visa fil

@ -148,9 +148,11 @@ export class CompareResultsNode extends SubscribeableViewNode {
}
private async getCommitsQuery(maxCount: number | undefined): Promise<CommitsQueryResults> {
const notation = Container.config.advanced.useSymmetricDifferenceNotation ? '...' : '..';
const log = await Container.git.getLog(this.uri.repoPath!, {
maxCount: maxCount,
ref: `${this._ref1.ref}...${this._ref2.ref || 'HEAD'}`
ref: `${this._ref1.ref}${notation}${this._ref2.ref || 'HEAD'}`
});
const count = log !== undefined ? log.count : 0;

Laddar…
Avbryt
Spara