From 8d54de146f670be3d2add454cb5716d2a799e305 Mon Sep 17 00:00:00 2001 From: Wenfang Du Date: Thu, 6 Jul 2023 18:52:41 +0800 Subject: [PATCH 1/2] fix: stash summary wasn't showing correctly --- package-lock.json | 4 ++-- src/Git/StashGit.ts | 4 ++-- src/StashLabels.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2fb512c..4b3bea4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gitstash", - "version": "5.1.0", + "version": "5.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gitstash", - "version": "5.1.0", + "version": "5.2.0", "license": "MIT", "dependencies": { "tmp": "0.2.1" diff --git a/src/Git/StashGit.ts b/src/Git/StashGit.ts index f850ddd..bb62f7d 100644 --- a/src/Git/StashGit.ts +++ b/src/Git/StashGit.ts @@ -51,13 +51,13 @@ export default class StashGit extends Git { const params = [ 'stash', 'list', - '--format="%ci %h %s"', + '--format="%ci %h %gs"', ] const stashList = (await this.exec(params, cwd)).trim() const sep1 = 26 // date length - const sep2 = 34 // date length + (1) space + (7) hash length + const sep2 = 32 // date length + (1) space + (7) hash length const list: Stash[] = !stashList.length ? [] : stashList .split(/\r?\n/g) diff --git a/src/StashLabels.ts b/src/StashLabels.ts index 003665c..80e42cd 100644 --- a/src/StashLabels.ts +++ b/src/StashLabels.ts @@ -112,7 +112,7 @@ export default class { private parseStashLabel(stashNode: StashNode, template: string): string { return template .replace('${index}', stashNode.index.toString()) - .replace('${branch}', this.getStashBranch(stashNode)) + .replace('${branch}, ', '') .replace('${description}', this.getStashDescription(stashNode)) .replace('${dateTimeLong}', DateFormat.toFullyReadable(new Date(Date.parse(stashNode.date)))) .replace('${dateTimeSmall}', DateFormat.toDateTimeSmall(new Date(Date.parse(stashNode.date)))) From dd79b5209c78cccafeac22630e14b5a086bb88c8 Mon Sep 17 00:00:00 2001 From: Wenfang Du Date: Fri, 7 Jul 2023 11:33:22 +0800 Subject: [PATCH 2/2] fix(ux): no distraction when dropping a stash --- src/StashCommands.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/StashCommands.ts b/src/StashCommands.ts index 5e7b155..248c530 100644 --- a/src/StashCommands.ts +++ b/src/StashCommands.ts @@ -257,7 +257,9 @@ export class StashCommands { this.performLogging(params, result, node) - this.showNotification(notificationText || result, type) + if (notificationText !== 'Stash dropped') { + this.showNotification(notificationText || result, type) + } } /**