@@ -117,6 +117,8 @@ type TreeElement =
117117 IResourceNode < SCMHistoryItemChangeTreeElement , SCMHistoryItemTreeElement > |
118118 SCMViewSeparatorElement ;
119119
120+ type ShowChangesSetting = 'always' | 'never' | 'auto' ;
121+
120122registerColor ( 'scm.historyItemAdditionsForeground' , {
121123 dark : 'gitDecoration.addedResourceForeground' ,
122124 light : 'gitDecoration.addedResourceForeground' ,
@@ -1023,8 +1025,6 @@ class SCMTreeFilter implements ITreeFilter<TreeElement> {
10231025 return true ;
10241026 } else if ( isSCMResourceGroup ( element ) ) {
10251027 return element . resources . length > 0 || ! element . hideWhenEmpty ;
1026- } else if ( isSCMHistoryItemGroupTreeElement ( element ) ) {
1027- return ( element . count ?? 0 ) > 0 ;
10281028 } else if ( isSCMViewSeparator ( element ) ) {
10291029 return element . repository . provider . groups . some ( g => g . resources . length > 0 ) ;
10301030 } else {
@@ -2351,8 +2351,11 @@ export class SCMViewPane extends ViewPane {
23512351 private _alwaysShowRepositories = false ;
23522352 get alwaysShowRepositories ( ) : boolean { return this . _alwaysShowRepositories ; }
23532353
2354- private _showSyncInformation : { incoming : boolean ; outgoing : boolean } = { incoming : false , outgoing : false } ;
2355- get showSyncInformation ( ) : { incoming : boolean ; outgoing : boolean } { return this . _showSyncInformation ; }
2354+ private _showIncomingChanges : ShowChangesSetting | undefined ;
2355+ get showIncomingChanges ( ) : ShowChangesSetting { return this . _showIncomingChanges ?? 'never' ; }
2356+
2357+ private _showOutgoingChanges : ShowChangesSetting | undefined ;
2358+ get showOutgoingChanges ( ) : ShowChangesSetting { return this . _showOutgoingChanges ?? 'never' ; }
23562359
23572360 private readonly items = new DisposableMap < ISCMRepository , IDisposable > ( ) ;
23582361 private readonly visibilityDisposables = new DisposableStore ( ) ;
@@ -2468,10 +2471,15 @@ export class SCMViewPane extends ViewPane {
24682471 await this . tree . setInput ( this . scmViewService , viewState ) ;
24692472
24702473 const onDidChangeConfiguration = ( e ?: IConfigurationChangeEvent ) => {
2471- if ( ! e || e . affectsConfiguration ( 'scm.showActionButton' ) || e . affectsConfiguration ( 'scm.alwaysShowRepositories' ) || e . affectsConfiguration ( 'scm.experimental.showSyncInformation' ) ) {
2474+ if ( ! e ||
2475+ e . affectsConfiguration ( 'scm.showActionButton' ) ||
2476+ e . affectsConfiguration ( 'scm.alwaysShowRepositories' ) ||
2477+ e . affectsConfiguration ( 'scm.showIncomingChanges' ) ||
2478+ e . affectsConfiguration ( 'scm.showOutgoingChanges' ) ) {
24722479 this . _showActionButton = this . configurationService . getValue < boolean > ( 'scm.showActionButton' ) ;
24732480 this . _alwaysShowRepositories = this . configurationService . getValue < boolean > ( 'scm.alwaysShowRepositories' ) ;
2474- this . _showSyncInformation = this . configurationService . getValue < { incoming : boolean ; outgoing : boolean } > ( 'scm.experimental.showSyncInformation' ) ;
2481+ this . _showIncomingChanges = this . configurationService . getValue < ShowChangesSetting > ( 'scm.showIncomingChanges' ) ;
2482+ this . _showOutgoingChanges = this . configurationService . getValue < ShowChangesSetting > ( 'scm.showOutgoingChanges' ) ;
24752483
24762484 if ( e ?. affectsConfiguration ( 'scm.alwaysShowRepositories' ) ) {
24772485 this . updateActions ( ) ;
@@ -2521,7 +2529,7 @@ export class SCMViewPane extends ViewPane {
25212529 actionRunner . onWillRun ( ( ) => this . tree . domFocus ( ) , this , this . disposables ) ;
25222530 this . disposables . add ( actionRunner ) ;
25232531
2524- this . treeDataSource = this . instantiationService . createInstance ( SCMTreeDataSource , ( ) => this . viewMode , ( ) => this . alwaysShowRepositories , ( ) => this . showActionButton , ( ) => this . showSyncInformation ) ;
2532+ this . treeDataSource = this . instantiationService . createInstance ( SCMTreeDataSource , ( ) => this . viewMode , ( ) => this . alwaysShowRepositories , ( ) => this . showActionButton , ( ) => this . showIncomingChanges , ( ) => this . showOutgoingChanges ) ;
25252533
25262534 this . tree = this . instantiationService . createInstance (
25272535 WorkbenchCompressibleAsyncDataTree ,
@@ -2970,7 +2978,8 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
29702978 private readonly viewMode : ( ) => ViewMode ,
29712979 private readonly alwaysShowRepositories : ( ) => boolean ,
29722980 private readonly showActionButton : ( ) => boolean ,
2973- private readonly showSyncInformation : ( ) => { incoming : boolean ; outgoing : boolean } ,
2981+ private readonly showIncomingChanges : ( ) => ShowChangesSetting ,
2982+ private readonly showOutgoingChanges : ( ) => ShowChangesSetting ,
29742983 @ISCMViewService private readonly scmViewService : ISCMViewService ,
29752984 @IUriIdentityService private uriIdentityService : IUriIdentityService ,
29762985 ) { }
@@ -3088,7 +3097,7 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
30883097 const historyProvider = scmProvider . historyProvider ;
30893098 const currentHistoryItemGroup = historyProvider ?. currentHistoryItemGroup ;
30903099
3091- if ( ! historyProvider || ! currentHistoryItemGroup || ( this . showSyncInformation ( ) . incoming === false && this . showSyncInformation ( ) . outgoing === false ) ) {
3100+ if ( ! historyProvider || ! currentHistoryItemGroup || ( this . showIncomingChanges ( ) === 'never' && this . showOutgoingChanges ( ) === 'never' ) ) {
30923101 return [ ] ;
30933102 }
30943103
@@ -3105,7 +3114,9 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
31053114 }
31063115
31073116 // Incoming
3108- if ( this . showSyncInformation ( ) . incoming && historyItemGroupDetails ?. incoming ) {
3117+ if ( historyItemGroupDetails ?. incoming &&
3118+ ( this . showIncomingChanges ( ) === 'always' ||
3119+ ( this . showIncomingChanges ( ) === 'auto' && ( historyItemGroupDetails . incoming . count ?? 0 ) > 0 ) ) ) {
31093120 children . push ( {
31103121 ...historyItemGroupDetails . incoming ,
31113122 repository : element ,
@@ -3114,7 +3125,9 @@ class SCMTreeDataSource implements IAsyncDataSource<ISCMViewService, TreeElement
31143125 }
31153126
31163127 // Outgoing
3117- if ( this . showSyncInformation ( ) . outgoing && historyItemGroupDetails ?. outgoing ) {
3128+ if ( historyItemGroupDetails ?. outgoing &&
3129+ ( this . showOutgoingChanges ( ) === 'always' ||
3130+ ( this . showOutgoingChanges ( ) === 'auto' && ( historyItemGroupDetails . outgoing . count ?? 0 ) > 0 ) ) ) {
31183131 children . push ( {
31193132 ...historyItemGroupDetails . outgoing ,
31203133 repository : element ,
0 commit comments