@@ -161,10 +161,10 @@ export class DataSource extends Disposable {
161161 * @param stashes An array of all stashes in the repository.
162162 * @returns The commits in the repository.
163163 */
164- public getCommits ( repo : string , branches : ReadonlyArray < string > | null , maxCommits : number , showTags : boolean , showRemoteBranches : boolean , includeCommitsMentionedByReflogs : boolean , onlyFollowFirstParent : boolean , commitOrdering : CommitOrdering , remotes : ReadonlyArray < string > , hideRemotes : ReadonlyArray < string > , stashes : ReadonlyArray < GitStash > ) : Promise < GitCommitData > {
164+ public getCommits ( repo : string , branches : ReadonlyArray < string > | null , authors : ReadonlyArray < string > | null , maxCommits : number , showTags : boolean , showRemoteBranches : boolean , includeCommitsMentionedByReflogs : boolean , onlyFollowFirstParent : boolean , commitOrdering : CommitOrdering , remotes : ReadonlyArray < string > , hideRemotes : ReadonlyArray < string > , stashes : ReadonlyArray < GitStash > ) : Promise < GitCommitData > {
165165 const config = getConfig ( ) ;
166166 return Promise . all ( [
167- this . getLog ( repo , branches , maxCommits + 1 , showTags && config . showCommitsOnlyReferencedByTags , showRemoteBranches , includeCommitsMentionedByReflogs , onlyFollowFirstParent , commitOrdering , remotes , hideRemotes , stashes ) ,
167+ this . getLog ( repo , branches , authors , maxCommits + 1 , showTags && config . showCommitsOnlyReferencedByTags , showRemoteBranches , includeCommitsMentionedByReflogs , onlyFollowFirstParent , commitOrdering , remotes , hideRemotes , stashes ) ,
168168 this . getRefs ( repo , showRemoteBranches , config . showRemoteHeads , hideRemotes ) . then ( ( refData : GitRefData ) => refData , ( errorMessage : string ) => errorMessage )
169169 ] ) . then ( async ( results ) => {
170170 let commits : GitCommitRecord [ ] = results [ 0 ] , refData : GitRefData | string = results [ 1 ] , i ;
@@ -288,8 +288,6 @@ export class DataSource extends Disposable {
288288 const consolidatedConfigs = results [ 0 ] , localConfigs = results [ 1 ] , globalConfigs = results [ 2 ] , authors = results [ 3 ] ;
289289
290290 const branches : GitRepoConfigBranches = { } ;
291- // const authors:ReadonlyArray<GitRepoConfigAuthor> = [];
292- console . warn ( authors ) ;
293291 Object . keys ( localConfigs ) . forEach ( ( key ) => {
294292 if ( key . startsWith ( 'branch.' ) ) {
295293 if ( key . endsWith ( '.remote' ) ) {
@@ -307,30 +305,6 @@ export class DataSource extends Disposable {
307305 }
308306 }
309307 } ) ;
310- console . warn ( { config : {
311- branches : branches ,
312- authors,
313- diffTool : getConfigValue ( consolidatedConfigs , GitConfigKey . DiffTool ) ,
314- guiDiffTool : getConfigValue ( consolidatedConfigs , GitConfigKey . DiffGuiTool ) ,
315- pushDefault : getConfigValue ( consolidatedConfigs , GitConfigKey . RemotePushDefault ) ,
316- remotes : remotes . map ( ( remote ) => ( {
317- name : remote ,
318- url : getConfigValue ( localConfigs , 'remote.' + remote + '.url' ) ,
319- pushUrl : getConfigValue ( localConfigs , 'remote.' + remote + '.pushurl' )
320- } ) ) ,
321- user : {
322- name : {
323- local : getConfigValue ( localConfigs , GitConfigKey . UserName ) ,
324- global : getConfigValue ( globalConfigs , GitConfigKey . UserName )
325- } ,
326- email : {
327- local : getConfigValue ( localConfigs , GitConfigKey . UserEmail ) ,
328- global : getConfigValue ( globalConfigs , GitConfigKey . UserEmail )
329- }
330- }
331- } ,
332- error : null
333- } ) ;
334308 return {
335309 config : {
336310 branches : branches ,
@@ -357,7 +331,6 @@ export class DataSource extends Disposable {
357331 error : null
358332 } ;
359333 } ) . catch ( ( errorMessage ) => {
360- console . log ( errorMessage ) ;
361334 return { config : null , error : errorMessage } ;
362335 } ) ;
363336 }
@@ -1570,11 +1543,16 @@ export class DataSource extends Disposable {
15701543 * @param stashes An array of all stashes in the repository.
15711544 * @returns An array of commits.
15721545 */
1573- private getLog ( repo : string , branches : ReadonlyArray < string > | null , num : number , includeTags : boolean , includeRemotes : boolean , includeCommitsMentionedByReflogs : boolean , onlyFollowFirstParent : boolean , order : CommitOrdering , remotes : ReadonlyArray < string > , hideRemotes : ReadonlyArray < string > , stashes : ReadonlyArray < GitStash > ) {
1546+ private getLog ( repo : string , branches : ReadonlyArray < string > | null , authors : ReadonlyArray < string > | null , num : number , includeTags : boolean , includeRemotes : boolean , includeCommitsMentionedByReflogs : boolean , onlyFollowFirstParent : boolean , order : CommitOrdering , remotes : ReadonlyArray < string > , hideRemotes : ReadonlyArray < string > , stashes : ReadonlyArray < GitStash > ) {
15741547 const args = [ '-c' , 'log.showSignature=false' , 'log' , '--max-count=' + num , '--format=' + this . gitFormatLog , '--' + order + '-order' ] ;
15751548 if ( onlyFollowFirstParent ) {
15761549 args . push ( '--first-parent' ) ;
15771550 }
1551+ if ( authors !== null ) {
1552+ for ( let i = 0 ; i < authors . length ; i ++ ) {
1553+ args . push ( `--author=${ authors [ i ] } ` ) ;
1554+ }
1555+ }
15781556 if ( branches !== null ) {
15791557 for ( let i = 0 ; i < branches . length ; i ++ ) {
15801558 args . push ( branches [ i ] ) ;
@@ -1593,7 +1571,6 @@ export class DataSource extends Disposable {
15931571 } ) ;
15941572 }
15951573 }
1596-
15971574 // Add the unique list of base hashes of stashes, so that commits only referenced by stashes are displayed
15981575 const stashBaseHashes = stashes . map ( ( stash ) => stash . baseHash ) ;
15991576 stashBaseHashes . filter ( ( hash , index ) => stashBaseHashes . indexOf ( hash ) === index ) . forEach ( ( hash ) => args . push ( hash ) ) ;
@@ -1602,6 +1579,8 @@ export class DataSource extends Disposable {
16021579 }
16031580 args . push ( '--' ) ;
16041581
1582+
1583+
16051584 return this . spawnGit ( args , repo , ( stdout ) => {
16061585 let lines = stdout . split ( EOL_REGEX ) ;
16071586 let commits : GitCommitRecord [ ] = [ ] ;
0 commit comments