@@ -66,65 +66,30 @@ export class CommitFileDetailsQuickPick {
6666
6767 await commit . resolvePreviousFileSha ( git ) ;
6868
69- if ( ! stash ) {
69+ if ( commit . previousFileShortSha ) {
7070 items . push ( new CommandQuickPickItem ( {
71- label : `$(git-commit) Show Commit Details ` ,
72- description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } $(git-commit) ${ commit . shortSha } `
73- } , Commands . ShowQuickCommitDetails , [
74- commit . toGitUri ( ) ,
71+ label : `$(git-compare) Open Changes ` ,
72+ description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } $(git-commit) ${ commit . previousFileShortSha } ${ GlyphChars . Space } $(git-compare) ${ GlyphChars . Space } $(git-commit) ${ commit . shortSha } `
73+ } , Commands . DiffWithPrevious , [
74+ commit . uri ,
7575 {
76- commit,
77- sha : commit . sha ,
78- goBackCommand : currentCommand
79- } as ShowQuickCommitDetailsCommandArgs
80- ] ) ) ;
81-
82- if ( commit . previousFileShortSha ) {
83- items . push ( new CommandQuickPickItem ( {
84- label : `$(git-compare) Compare File with Previous Revision` ,
85- description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } $(git-commit) ${ commit . previousFileShortSha } ${ GlyphChars . Space } $(git-compare) ${ GlyphChars . Space } $(git-commit) ${ commit . shortSha } `
86- } , Commands . DiffWithPrevious , [
87- commit . uri ,
88- {
89- commit
90- } as DiffWithPreviousCommandArgs
91- ] ) ) ;
92- }
76+ commit
77+ } as DiffWithPreviousCommandArgs
78+ ] )
79+ ) ;
9380 }
9481
9582 if ( commit . workingFileName ) {
9683 items . push ( new CommandQuickPickItem ( {
97- label : `$(git-compare) Compare File with Working Revision ` ,
84+ label : `$(git-compare) Open Changes with Working Tree ` ,
9885 description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } $(git-commit) ${ commit . shortSha } ${ GlyphChars . Space } $(git-compare) ${ GlyphChars . Space } $(file-text) ${ workingName } `
9986 } , Commands . DiffWithWorking , [
10087 Uri . file ( path . resolve ( commit . repoPath , commit . workingFileName ) ) ,
10188 {
10289 commit
10390 } as DiffWithWorkingCommandArgs
104- ] ) ) ;
105- }
106-
107- if ( ! stash ) {
108- items . push ( new CommandQuickPickItem ( {
109- label : `$(clippy) Copy Commit ID to Clipboard` ,
110- description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } ${ commit . shortSha } `
111- } , Commands . CopyShaToClipboard , [
112- uri ,
113- {
114- sha : commit . sha
115- } as CopyShaToClipboardCommandArgs
116- ] ) ) ;
117-
118- items . push ( new CommandQuickPickItem ( {
119- label : `$(clippy) Copy Message to Clipboard` ,
120- description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } ${ commit . message } `
121- } , Commands . CopyMessageToClipboard , [
122- uri ,
123- {
124- message : commit . message ,
125- sha : commit . sha
126- } as CopyMessageToClipboardCommandArgs
127- ] ) ) ;
91+ ] )
92+ ) ;
12893 }
12994
13095 if ( commit . workingFileName && commit . status !== 'D' ) {
@@ -142,6 +107,7 @@ export class CommitFileDetailsQuickPick {
142107 branch : branch ! . name
143108 } as RemoteResource , currentCommand ) ) ;
144109 }
110+
145111 if ( ! stash ) {
146112 items . push ( new OpenRemotesCommandQuickPickItem ( remotes , {
147113 type : 'revision' ,
@@ -151,6 +117,45 @@ export class CommitFileDetailsQuickPick {
151117 }
152118 }
153119
120+ if ( ! stash ) {
121+ items . push ( new CommandQuickPickItem ( {
122+ label : `$(clippy) Copy Commit ID to Clipboard` ,
123+ description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } ${ commit . shortSha } `
124+ } , Commands . CopyShaToClipboard , [
125+ uri ,
126+ {
127+ sha : commit . sha
128+ } as CopyShaToClipboardCommandArgs
129+ ] )
130+ ) ;
131+
132+ items . push ( new CommandQuickPickItem ( {
133+ label : `$(clippy) Copy Commit Message to Clipboard` ,
134+ description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } ${ commit . message } `
135+ } , Commands . CopyMessageToClipboard , [
136+ uri ,
137+ {
138+ message : commit . message ,
139+ sha : commit . sha
140+ } as CopyMessageToClipboardCommandArgs
141+ ] ) ) ;
142+ }
143+
144+ if ( ! stash ) {
145+ items . push ( new CommandQuickPickItem ( {
146+ label : `$(git-commit) Show Commit Details` ,
147+ description : `${ Strings . pad ( GlyphChars . Dash , 2 , 3 ) } $(git-commit) ${ commit . shortSha } `
148+ } , Commands . ShowQuickCommitDetails , [
149+ commit . toGitUri ( ) ,
150+ {
151+ commit,
152+ sha : commit . sha ,
153+ goBackCommand : currentCommand
154+ } as ShowQuickCommitDetailsCommandArgs
155+ ] )
156+ ) ;
157+ }
158+
154159 if ( commit . workingFileName ) {
155160 items . push ( new CommandQuickPickItem ( {
156161 label : `$(history) Show File History` ,
@@ -282,7 +287,7 @@ export class CommitFileDetailsQuickPick {
282287
283288 const pick = await window . showQuickPick ( items , {
284289 matchOnDescription : true ,
285- placeHolder : `${ commit . getFormattedPath ( ) } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ isUncommitted ? `Uncommitted ${ GlyphChars . ArrowRightHollow } ` : '' } ${ commit . shortSha } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ commit . author } , ${ commit . fromNow ( ) } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ commit . message } ` ,
290+ placeHolder : `${ commit . getFormattedPath ( ) } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ isUncommitted ? `Uncommitted ${ GlyphChars . ArrowRightHollow } ` : '' } ${ commit . shortSha } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ commit . author } , ${ commit . fromNow ( ) } ${ Strings . pad ( GlyphChars . Dot , 1 , 1 ) } ${ commit . message } ` ,
286291 ignoreFocusOut : getQuickPickIgnoreFocusOut ( ) ,
287292 onDidSelectItem : ( item : QuickPickItem ) => {
288293 scope . setKeyCommand ( 'right' , item as KeyCommand ) ;
0 commit comments