Browse Source

Renames to abbreviateShaOnCopy & copy tweaks

main
Eric Amodio 4 years ago
parent
commit
66ec481bae
5 changed files with 10 additions and 10 deletions
  1. +1
    -1
      CHANGELOG.md
  2. +1
    -1
      README.md
  3. +6
    -6
      package.json
  4. +1
    -1
      src/commands/copyShaToClipboard.ts
  5. +1
    -1
      src/config.ts

+ 1
- 1
CHANGELOG.md View File

@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds a new _Browse Repository from Before Here_ (`gitlens.browseRepoBeforeRevision`) and _Browse Repository from Before Here in New Window_ (`gitlens.browseRepoBeforeRevisionInNewWindow`) commands
- Adds _Repository from Before Here_ and _Repository from Before Here in New Window_ to the _Browse_ submenu of commits in the views
- Adds a new _Copy Current Branch Name_ (`gitlens.copyCurrentBranch`) command to copy the current branch name to the clipboard — closes [#1306](https://github.com/eamodio/vscode-gitlens/issues/1306) — thanks to [PR #1307](https://github.com/eamodio/vscode-gitlens/pull/1307) by Ken Hom ([@kh0m](https://github.com/kh0m))
- Adds a `gitlens.advanced.useAbbreviatedShaLengthForCopy` setting to copy the abbreviated commit SHA to the clipboard — closes [#1062](https://github.com/eamodio/vscode-gitlens/issues/1062) — thanks to [PR #1316](https://github.com/eamodio/vscode-gitlens/pull/1316) by Brendon Smith ([@br3ndonland](https://github.com/br3ndonland))
- Adds a `gitlens.advanced.abbreviateShaOnCopy` setting specify to whether to copy full or abbreviated commit SHAs to the clipboard. Abbreviates to the length of `gitlens.advanced.abbreviatedShaLength` — closes [#1062](https://github.com/eamodio/vscode-gitlens/issues/1062) — thanks to [PR #1316](https://github.com/eamodio/vscode-gitlens/pull/1316) by Brendon Smith ([@br3ndonland](https://github.com/br3ndonland))
### Changed

+ 1
- 1
README.md View File

@ -957,7 +957,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `gitlens.showWelcomeOnInstall` | Specifies whether to show the Welcome (Quick Setup) experience on first install |
| `gitlens.showWhatsNewAfterUpgrades` | Specifies whether to show the What's New notification after upgrading to new feature releases |
| `gitlens.advanced.abbreviatedShaLength` | Specifies the length of abbreviated commit SHAs (shas) |
| `gitlens.advanced.useAbbreviatedShaLengthForCopy` | Specifies whether abbreviated commit SHAs should be copied instead of full-length SHAs. Respects `abbreviatedShaLength`. |
| `gitlens.advanced.abbreviateShaOnCopy` | Specifies whether to copy full or abbreviated commit SHAs to the clipboard. Abbreviates to the length of `gitlens.advanced.abbreviatedShaLength`.. |
| `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 |

+ 6
- 6
package.json View File

@ -2345,6 +2345,12 @@
"markdownDescription": "Specifies the length of abbreviated commit SHAs",
"scope": "window"
},
"gitlens.advanced.abbreviateShaOnCopy": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to copy full or abbreviated commit SHAs to the clipboard. Abbreviates to the length of `#gitlens.advanced.abbreviatedShaLength#`.",
"scope": "window"
},
"gitlens.advanced.blame.customArguments": {
"type": [
"array",
@ -2464,12 +2470,6 @@
"markdownDescription": "Specifies the amount (percent) of similarity a deleted and added file pair must have to be considered a rename",
"scope": "window"
},
"gitlens.advanced.useAbbreviatedShaLengthForCopy": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether abbreviated commit SHAs should be copied instead of full-length SHAs. Respects `abbreviatedShaLength`.",
"scope": "window"
},
"gitlens.advanced.useSymmetricDifferenceNotation": {
"type": "boolean",
"default": true,

+ 1
- 1
src/commands/copyShaToClipboard.ts View File

@ -29,7 +29,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
protected preExecute(context: CommandContext, args?: CopyShaToClipboardCommandArgs) {
if (isCommandContextViewNodeHasCommit(context)) {
args = { ...args };
args.sha = Container.config.advanced.useAbbreviatedShaLengthForCopy
args.sha = Container.config.advanced.abbreviateShaOnCopy
? context.node.commit.shortSha
: context.node.commit.sha;
return this.execute(context.editor, context.node.commit.uri, args);

+ 1
- 1
src/config.ts View File

@ -278,6 +278,7 @@ export enum ViewShowBranchComparison {
export interface AdvancedConfig {
abbreviatedShaLength: number;
abbreviateShaOnCopy: boolean;
blame: {
customArguments: string[] | null;
delayAfterEdit: number;
@ -304,7 +305,6 @@ export interface AdvancedConfig {
};
repositorySearchDepth: number;
similarityThreshold: number | null;
useAbbreviatedShaLengthForCopy: boolean;
useSymmetricDifferenceNotation: boolean;
}

Loading…
Cancel
Save