mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 01:35:36 -05:00
Switches everything to use full shas
This commit is contained in:
@@ -14,8 +14,8 @@ export class OpenCommitFilesCommandQuickPickItem extends OpenFilesCommandQuickPi
|
||||
const uris = commit.fileStatuses.map(_ => GitProvider.toGitContentUri(commit.sha, _.fileName, repoPath, commit.originalFileName));
|
||||
super(uris, item || {
|
||||
label: `$(file-symlink-file) Open Changed Files`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 in \u00a0$(git-commit) ${commit.sha}`
|
||||
//detail: `Opens all of the changed files in $(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 in \u00a0$(git-commit) ${commit.shortSha}`
|
||||
//detail: `Opens all of the changed files in $(git-commit) ${commit.shortSha}`
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export class CommitDetailsQuickPick {
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
label: `$(clippy) Copy Commit Sha to Clipboard`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.shortSha}`
|
||||
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
@@ -52,12 +52,12 @@ export class CommitDetailsQuickPick {
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
label: `$(git-compare) Directory Compare with Previous Commit`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.previousSha || `${commit.sha}^`} \u00a0 $(git-compare) \u00a0 $(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.previousShortSha || `${commit.shortSha}^`} \u00a0 $(git-compare) \u00a0 $(git-commit) ${commit.shortSha}`
|
||||
}, Commands.DiffDirectory, [commit.uri, commit.previousSha || `${commit.sha}^`, commit.sha]));
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
label: `$(git-compare) Directory Compare with Working Tree`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.sha} \u00a0 $(git-compare) \u00a0 $(file-directory) Working Tree`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.shortSha} \u00a0 $(git-compare) \u00a0 $(file-directory) Working Tree`
|
||||
}, Commands.DiffDirectory, [uri, commit.sha]));
|
||||
|
||||
items.splice(index++, 0, new CommandQuickPickItem({
|
||||
@@ -77,7 +77,7 @@ export class CommitDetailsQuickPick {
|
||||
const pick = await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: `${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
placeHolder: `${commit.shortSha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
|
||||
onDidSelectItem: (item: QuickPickItem) => {
|
||||
Keyboard.instance.setKeyCommand('right', item);
|
||||
|
||||
@@ -13,7 +13,7 @@ export class OpenCommitFileCommandQuickPickItem extends OpenFileCommandQuickPick
|
||||
const uri = GitProvider.toGitContentUri(commit);
|
||||
super(uri, item || {
|
||||
label: `$(file-symlink-file) Open File`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${path.basename(commit.fileName)} in \u00a0$(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${path.basename(commit.fileName)} in \u00a0$(git-commit) ${commit.shortSha}`
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -48,25 +48,25 @@ export class CommitFileDetailsQuickPick {
|
||||
if (!options.showFileHistory) {
|
||||
items.push(new CommandQuickPickItem({
|
||||
label: `$(git-commit) Show Commit Details`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.shortSha}`
|
||||
}, Commands.ShowQuickCommitDetails, [new GitUri(commit.uri, commit), commit.sha, commit, currentCommand]));
|
||||
}
|
||||
|
||||
if (commit.previousSha) {
|
||||
items.push(new CommandQuickPickItem({
|
||||
label: `$(git-compare) Compare with Previous Commit`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.previousSha} \u00a0 $(git-compare) \u00a0 $(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.previousShortSha} \u00a0 $(git-compare) \u00a0 $(git-commit) ${commit.shortSha}`
|
||||
}, Commands.DiffWithPrevious, [commit.uri, commit]));
|
||||
}
|
||||
|
||||
items.push(new CommandQuickPickItem({
|
||||
label: `$(git-compare) Compare with Working Tree`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.sha} \u00a0 $(git-compare) \u00a0 $(file-text) ${workingName}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.shortSha} \u00a0 $(git-compare) \u00a0 $(file-text) ${workingName}`
|
||||
}, Commands.DiffWithWorking, [uri, commit]));
|
||||
|
||||
items.push(new CommandQuickPickItem({
|
||||
label: `$(clippy) Copy Commit Sha to Clipboard`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 ${commit.shortSha}`
|
||||
}, Commands.CopyShaToClipboard, [uri, commit.sha]));
|
||||
|
||||
items.push(new CommandQuickPickItem({
|
||||
@@ -86,7 +86,7 @@ export class CommitFileDetailsQuickPick {
|
||||
|
||||
items.push(new CommandQuickPickItem({
|
||||
label: `$(history) Show ${workingFileName && options.showFileHistory ? 'Previous ' : ''}File History`,
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 of ${path.basename(commit.fileName)} \u00a0\u2022\u00a0 starting from \u00a0$(git-commit) ${commit.sha}`
|
||||
description: `\u00a0 \u2014 \u00a0\u00a0 of ${path.basename(commit.fileName)} \u00a0\u2022\u00a0 starting from \u00a0$(git-commit) ${commit.shortSha}`
|
||||
}, Commands.ShowQuickFileHistory, [new GitUri(commit.uri, commit), undefined, currentCommand]));
|
||||
|
||||
if (goBackCommand) {
|
||||
@@ -97,7 +97,7 @@ export class CommitFileDetailsQuickPick {
|
||||
|
||||
const pick = await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
placeHolder: `${commit.getFormattedPath()} \u2022 ${isUncommitted ? 'Uncommitted \u21E8 ' : '' }${commit.sha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
placeHolder: `${commit.getFormattedPath()} \u2022 ${isUncommitted ? 'Uncommitted \u21E8 ' : '' }${commit.shortSha} \u2022 ${commit.author}, ${moment(commit.date).fromNow()} \u2022 ${commit.message}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
|
||||
onDidSelectItem: (item: QuickPickItem) => {
|
||||
Keyboard.instance.setKeyCommand('right', item);
|
||||
|
||||
@@ -48,7 +48,7 @@ export class FileHistoryQuickPick {
|
||||
const pick = await window.showQuickPick(items, {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: `${commit.getFormattedPath()}${sha ? ` \u00a0\u2022\u00a0 ${sha}` : ''}`,
|
||||
placeHolder: `${commit.getFormattedPath()}${sha ? ` \u00a0\u2022\u00a0 ${sha.substring(0, 8)}` : ''}`,
|
||||
ignoreFocusOut: getQuickPickIgnoreFocusOut(),
|
||||
onDidSelectItem: (item: QuickPickItem) => {
|
||||
Keyboard.instance.setKeyCommand('right', item);
|
||||
|
||||
@@ -13,7 +13,7 @@ export class CommitQuickPickItem implements QuickPickItem {
|
||||
|
||||
constructor(public commit: GitCommit, descriptionSuffix: string = '') {
|
||||
this.label = `${commit.author}, ${moment(commit.date).fromNow()}`;
|
||||
this.description = `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.sha}${descriptionSuffix}`;
|
||||
this.description = `\u00a0 \u2014 \u00a0\u00a0 $(git-commit) ${commit.shortSha}${descriptionSuffix}`;
|
||||
this.detail = commit.message;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickI
|
||||
fileName: string;
|
||||
gitUri: GitUri;
|
||||
sha: string;
|
||||
shortSha: string;
|
||||
status: GitFileStatus;
|
||||
|
||||
constructor(commit: GitCommit, fileName: string, status: GitFileStatus) {
|
||||
@@ -41,6 +42,7 @@ export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickI
|
||||
this.fileName = fileName;
|
||||
this.gitUri = new GitUri(Uri.file(path.resolve(commit.repoPath, fileName)));
|
||||
this.sha = commit.sha;
|
||||
this.shortSha = commit.shortSha;
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user