@@ -2267,7 +2267,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
22672267 const statsParser = getGraphStatsParser ( ) ;
22682268
22692269 const [ refResult , stashResult , branchesResult , remotesResult , currentUserResult ] = await Promise . allSettled ( [
2270- this . git . log2 ( repoPath , undefined , ...refParser . arguments , '-n1' , options ?. ref ?? 'HEAD' ) ,
2270+ this . git . log ( repoPath , undefined , ...refParser . arguments , '-n1' , options ?. ref ?? 'HEAD' ) ,
22712271 this . getStash ( repoPath ) ,
22722272 this . getBranches ( repoPath ) ,
22732273 this . getRemotes ( repoPath ) ,
@@ -2339,7 +2339,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
23392339 } else {
23402340 args . push ( `-n${ nextPageLimit + 1 } ` ) ;
23412341
2342- data = await this . git . log2 ( repoPath , stdin ? { stdin : stdin } : undefined , ...args ) ;
2342+ data = await this . git . log ( repoPath , stdin ? { stdin : stdin } : undefined , ...args ) ;
23432343
23442344 if ( cursor ) {
23452345 if ( ! getShaInLogRegex ( cursor . sha ) . test ( data ) ) {
@@ -2727,7 +2727,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
27272727 }
27282728 args . push ( `--${ ordering } -order` , '--all' ) ;
27292729
2730- const statsData = await this . git . log2 ( repoPath , stdin ? { stdin : stdin } : undefined , ...args ) ;
2730+ const statsData = await this . git . log ( repoPath , stdin ? { stdin : stdin } : undefined , ...args ) ;
27312731 if ( statsData ) {
27322732 const commitStats = statsParser . parse ( statsData ) ;
27332733 for ( const stat of commitStats ) {
@@ -2810,10 +2810,12 @@ export class LocalGitProvider implements GitProvider, Disposable {
28102810 const currentUser = await this . getCurrentUser ( repoPath ) ;
28112811 const parser = getContributorsParser ( options ?. stats ) ;
28122812
2813- const data = await this . git . log ( repoPath , options ?. ref , {
2814- all : options ?. all ,
2815- argsOrFormat : parser . arguments ,
2816- } ) ;
2813+ const args = [ ...parser . arguments , '--full-history' , '--first-parent' ] ;
2814+ if ( options ?. all ) {
2815+ args . push ( '--all' , '--single-worktree' ) ;
2816+ }
2817+
2818+ const data = await this . git . log ( repoPath , { ref : options ?. ref } , ...args ) ;
28172819
28182820 const contributors = new Map < string , GitContributor > ( ) ;
28192821
@@ -3320,14 +3322,10 @@ export class LocalGitProvider implements GitProvider, Disposable {
33203322
33213323 try {
33223324 const limit = options ?. limit ?? configuration . get ( 'advanced.maxListItems' ) ?? 0 ;
3323- const merges = options ?. merges == null ? true : options . merges ;
3324- const ordering = options ?. ordering ?? configuration . get ( 'advanced.commitOrdering' ) ;
33253325 const similarityThreshold = configuration . get ( 'advanced.similarityThreshold' ) ;
3326-
33273326 const args = [
33283327 `--format=${ options ?. all ? parseGitLogAllFormat : parseGitLogDefaultFormat } ` ,
33293328 `-M${ similarityThreshold == null ? '' : `${ similarityThreshold } %` } ` ,
3330- '-m' ,
33313329 ] ;
33323330
33333331 if ( options ?. status !== null ) {
@@ -3336,11 +3334,19 @@ export class LocalGitProvider implements GitProvider, Disposable {
33363334 if ( options ?. all ) {
33373335 args . push ( '--all' ) ;
33383336 }
3339- if ( ! merges ) {
3337+
3338+ const merges = options ?. merges ?? true ;
3339+ if ( merges ) {
3340+ if ( limit <= 2 ) {
3341+ // Ensure we return the merge commit files when we are asking for a specific ref
3342+ args . push ( '-m' ) ;
3343+ }
3344+ args . push ( merges === 'first-parent' ? '--first-parent' : '--no-min-parents' ) ;
3345+ } else {
33403346 args . push ( '--no-merges' ) ;
3341- } else if ( merges === 'first-parent' ) {
3342- args . push ( '--first-parent' ) ;
33433347 }
3348+
3349+ const ordering = options ?. ordering ?? configuration . get ( 'advanced.commitOrdering' ) ;
33443350 if ( ordering ) {
33453351 args . push ( `--${ ordering } -order` ) ;
33463352 }
@@ -3374,7 +3380,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
33743380 args . push ( `-n${ limit + 1 } ` ) ;
33753381 }
33763382
3377- const data = await this . git . log2 (
3383+ const data = await this . git . log (
33783384 repoPath ,
33793385 { configs : gitLogDefaultConfigsWithFiles , ref : options ?. ref , stdin : options ?. stdin } ,
33803386 ...args ,
@@ -3437,8 +3443,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
34373443 if ( log . hasMore ) {
34383444 let opts ;
34393445 if ( options != null ) {
3440- let extraArgs ;
3441- ( { extraArgs, ...opts } = options ) ;
3446+ let _ ;
3447+ ( { extraArgs : _ , ...opts } = options ) ;
34423448 }
34433449 log . more = this . getLogMoreFn ( log , opts ) ;
34443450 }
@@ -3459,7 +3465,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
34593465 authors ?: GitUser [ ] ;
34603466 cursor ?: string ;
34613467 limit ?: number ;
3462- merges ?: boolean ;
3468+ merges ?: boolean | 'first-parent' ;
34633469 ordering ?: 'date' | 'author-date' | 'topo' | null ;
34643470 ref ?: string ;
34653471 since ?: string ;
@@ -3471,16 +3477,36 @@ export class LocalGitProvider implements GitProvider, Disposable {
34713477
34723478 try {
34733479 const parser = createLogParserSingle ( '%H' ) ;
3480+ const args = [ ...parser . arguments , '--full-history' ] ;
34743481
3475- const data = await this . git . log ( repoPath , options ?. ref , {
3476- authors : options ?. authors ,
3477- argsOrFormat : parser . arguments ,
3478- limit : limit ,
3479- merges : options ?. merges == null ? true : options . merges ,
3480- similarityThreshold : configuration . get ( 'advanced.similarityThreshold' ) ,
3481- since : options ?. since ,
3482- ordering : options ?. ordering ?? configuration . get ( 'advanced.commitOrdering' ) ,
3483- } ) ;
3482+ const ordering = options ?. ordering ?? configuration . get ( 'advanced.commitOrdering' ) ;
3483+ if ( ordering ) {
3484+ args . push ( `--${ ordering } -order` ) ;
3485+ }
3486+
3487+ if ( limit ) {
3488+ args . push ( `-n${ limit + 1 } ` ) ;
3489+ }
3490+
3491+ if ( options ?. since ) {
3492+ args . push ( `--since="${ options . since } "` ) ;
3493+ }
3494+
3495+ const merges = options ?. merges ?? true ;
3496+ if ( merges ) {
3497+ args . push ( merges === 'first-parent' ? '--first-parent' : '--no-min-parents' ) ;
3498+ } else {
3499+ args . push ( '--no-merges' ) ;
3500+ }
3501+
3502+ if ( options ?. authors ?. length ) {
3503+ if ( ! args . includes ( '--use-mailmap' ) ) {
3504+ args . push ( '--use-mailmap' ) ;
3505+ }
3506+ args . push ( ...options . authors . map ( a => `--author=^${ a . name } <${ a . email } >$` ) ) ;
3507+ }
3508+
3509+ const data = await this . git . log ( repoPath , { ref : options ?. ref } , ...args ) ;
34843510
34853511 const commits = new Set ( parser . parse ( data ) ) ;
34863512 return commits ;
@@ -5304,7 +5330,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
53045330
53055331 let data ;
53065332 try {
5307- data = await this . git . log2 (
5333+ data = await this . git . log (
53085334 repoPath ,
53095335 {
53105336 cancellation : options ?. cancellation ,
0 commit comments