Browse Source

Adds the option to change the length of the abbreviated commit SHA.

main
Luxray5474 6 years ago
committed by Eric Amodio
parent
commit
6a5e001444
4 changed files with 11 additions and 3 deletions
  1. +2
    -1
      README.md
  2. +6
    -0
      package.json
  3. +2
    -2
      src/git/git.ts
  4. +1
    -0
      src/ui/config.ts

+ 2
- 1
README.md View File

@ -841,7 +841,8 @@ 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 the abbreviated commit SHA (a.k.a. commit ID). Default is 7.
| `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
- 0
package.json View File

@ -1583,6 +1583,12 @@
"markdownDescription": "Specifies the description format of the status of a working or committed file in the views\n- Available tokens\n - `${directory}` — directory name\n - `${file}` — file name\n - `${filePath}` — formatted file name and path\n - `${path}` — full file path\n - `${working}` — optional indicator if the file is uncommitted",
"scope": "window"
},
"gitlens.advanced.abbreviatedShaLength": {
"type": "number",
"default": "7",
"markdownDescription": "Specifies the length of the abbreviated commit SHA (a.k.a. commit ID). Default is 7.",
"scope": "window"
},
"gitlens.advanced.blame.customArguments": {
"type": "array",
"default": null,

+ 2
- 2
src/git/git.ts View File

@ -285,9 +285,9 @@ export class Git {
if (index > 5) {
// Only grab a max of 5 chars for the suffix
const suffix = ref.substring(index).substring(0, 5);
return `${ref.substring(0, 7 - suffix.length)}${suffix}`;
return `${ref.substring(0, Container.config.advanced.abbreviatedShaLength - suffix.length)}${suffix}`;
}
return ref.substring(0, 7);
return ref.substring(0, Container.config.advanced.abbreviatedShaLength);
}
static splitPath(fileName: string, repoPath: string | undefined, extract: boolean = true): [string, string] {

+ 1
- 0
src/ui/config.ts View File

@ -186,6 +186,7 @@ export enum ViewFilesLayout {
}
export interface AdvancedConfig {
abbreviatedShaLength: number;
blame: {
customArguments: string[] | null;
delayAfterEdit: number;

Loading…
Cancel
Save