Browse Source

Closes #2078 - Shows diff shortstat in comparison

main
Nafiur Rahman Khadem 2 years ago
committed by Eric Amodio
parent
commit
e008d4684e
3 changed files with 15 additions and 2 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -1
      src/views/nodes/compareBranchNode.ts
  3. +7
    -1
      src/views/nodes/compareResultsNode.ts

+ 1
- 0
CHANGELOG.md View File

@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds new stash behaviors to use the Source Control (commit message) input box — closes [#2081](https://github.com/gitkraken/vscode-gitlens/issues/2081)
- When a stash is applied or popped and the Source Control input is empty, we will now update the Source Control input to the stash message
- When stashing changes and the Source Control input is not empty, we will now default the stash message input to the Source Control input value
- Adds stats (additions & deletions) to files nodes in comparisons — closes [#2078](https://github.com/gitkraken/vscode-gitlens/issues/2078)
### Changed

+ 7
- 1
src/views/nodes/compareBranchNode.ts View File

@ -328,9 +328,15 @@ export class CompareBranchNode extends ViewNode
}
const files = (await this.view.container.git.getDiffStatus(this.repoPath, comparison)) ?? [];
const shortstat = await this.view.container.git.getChangedFilesCount(this.uri.repoPath!, comparison);
return {
label: `${pluralize('file', files.length, { zero: 'No' })} changed`,
label:
`${pluralize('file', files.length, { zero: 'No' })} changed` +
` with ${pluralize('addition', shortstat?.additions ?? 0)} and ${pluralize(
'deletion',
shortstat?.deletions ?? 0,
)}`,
files: files,
};
}

+ 7
- 1
src/views/nodes/compareResultsNode.ts View File

@ -318,9 +318,15 @@ export class CompareResultsNode extends ViewNode {
}
const files = (await this.view.container.git.getDiffStatus(this.repoPath, comparison)) ?? [];
const shortstat = await this.view.container.git.getChangedFilesCount(this.uri.repoPath!, comparison);
return {
label: `${pluralize('file', files.length, { zero: 'No' })} changed`,
label:
`${pluralize('file', files.length, { zero: 'No' })} changed` +
` with ${pluralize('addition', shortstat?.additions ?? 0)} and ${pluralize(
'deletion',
shortstat?.deletions ?? 0,
)}`,
files: files,
};
}

Loading…
Cancel
Save