@@ -301,6 +301,7 @@ import {
301301 installLFSHooks ,
302302 isUsingLFS ,
303303} from '../git/lfs'
304+ import { getConfigValueWithOrigin , IConfigValueOrigin } from '../git/config'
304305import { determineMergeability } from '../git/merge-tree'
305306import { listWorktrees } from '../git/worktree'
306307import { reorder } from '../git/reorder'
@@ -464,6 +465,9 @@ const hideWhitespaceInPullRequestDiffKey =
464465const commitSpellcheckEnabledDefault = true
465466const commitSpellcheckEnabledKey = 'commit-spellcheck-enabled'
466467
468+ const showCommitAuthorInfoDefault = false
469+ const showCommitAuthorInfoKey = 'show-commit-author-info'
470+
467471export const tabSizeDefault : number = 4
468472const tabSizeKey : string = 'tab-size'
469473
@@ -610,6 +614,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
610614 hideWhitespaceInPullRequestDiffDefault
611615 /** Whether or not the spellchecker is enabled for commit summary and description */
612616 private commitSpellcheckEnabled : boolean = commitSpellcheckEnabledDefault
617+ private showCommitAuthorInfo : boolean = showCommitAuthorInfoDefault
613618 private showSideBySideDiff : boolean = ShowSideBySideDiffDefault
614619
615620 private uncommittedChangesStrategy = defaultUncommittedChangesStrategy
@@ -1226,6 +1231,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
12261231 repositoryIndicatorsEnabled : this . repositoryIndicatorsEnabled ,
12271232 hideWindowOnQuit : this . hideWindowOnQuit ,
12281233 commitSpellcheckEnabled : this . commitSpellcheckEnabled ,
1234+ showCommitAuthorInfo : this . showCommitAuthorInfo ,
12291235 currentDragElement : this . currentDragElement ,
12301236 lastThankYou : this . lastThankYou ,
12311237 useCustomEditor : this . useCustomEditor ,
@@ -2592,6 +2598,10 @@ export class AppStore extends TypedBaseStore<IAppState> {
25922598 commitSpellcheckEnabledKey ,
25932599 commitSpellcheckEnabledDefault
25942600 )
2601+ this . showCommitAuthorInfo = getBoolean (
2602+ showCommitAuthorInfoKey ,
2603+ showCommitAuthorInfoDefault
2604+ )
25952605 this . showSideBySideDiff = getShowSideBySideDiff ( )
25962606
25972607 this . selectedTheme = getPersistedThemeName ( )
@@ -4227,6 +4237,17 @@ export class AppStore extends TypedBaseStore<IAppState> {
42274237 this . emitUpdate ( )
42284238 }
42294239
4240+ public _setShowCommitAuthorInfo ( showCommitAuthorInfo : boolean ) {
4241+ if ( this . showCommitAuthorInfo === showCommitAuthorInfo ) {
4242+ return
4243+ }
4244+
4245+ setBoolean ( showCommitAuthorInfoKey , showCommitAuthorInfo )
4246+ this . showCommitAuthorInfo = showCommitAuthorInfo
4247+
4248+ this . emitUpdate ( )
4249+ }
4250+
42304251 public _setUseWindowsOpenSSH ( useWindowsOpenSSH : boolean ) {
42314252 setBoolean ( UseWindowsOpenSSHKey , useWindowsOpenSSH )
42324253 this . useWindowsOpenSSH = useWindowsOpenSSH
@@ -4299,8 +4320,22 @@ export class AppStore extends TypedBaseStore<IAppState> {
42994320 getAuthorIdentity ( repository )
43004321 ) ) || null
43014322
4323+ let commitAuthorNameOrigin : IConfigValueOrigin | null = null
4324+ let commitAuthorEmailOrigin : IConfigValueOrigin | null = null
4325+
4326+ try {
4327+ ; [ commitAuthorNameOrigin , commitAuthorEmailOrigin ] = await Promise . all ( [
4328+ getConfigValueWithOrigin ( repository , 'user.name' ) ,
4329+ getConfigValueWithOrigin ( repository , 'user.email' ) ,
4330+ ] )
4331+ } catch ( e ) {
4332+ log . warn ( 'Failed to get config value origins' , e )
4333+ }
4334+
43024335 this . repositoryStateCache . update ( repository , ( ) => ( {
43034336 commitAuthor,
4337+ commitAuthorNameOrigin,
4338+ commitAuthorEmailOrigin,
43044339 } ) )
43054340 this . emitUpdate ( )
43064341 }
0 commit comments