MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / pickCommits

Function pickCommits

evals/buffbench/pick-commits.ts:475–567  ·  view source on GitHub ↗
({
  repoUrl,
  outputPath,
  clientSessionId,
  limit = 200,
  afterCommit,
}: {
  repoUrl: string
  outputPath?: string
  clientSessionId: string
  limit?: number
  afterCommit?: string
})

Source from the content-addressed store, hash-verified

473 return selectedCommits
474}
475export async function pickCommits({
476 repoUrl,
477 outputPath,
478 clientSessionId,
479 limit = 200,
480 afterCommit,
481}: {
482 repoUrl: string
483 outputPath?: string
484 clientSessionId: string
485 limit?: number
486 afterCommit?: string
487}): Promise<void> {
488 const repoName = extractRepoNameFromUrl(repoUrl)
489 console.log(`Picking commits from repository: ${repoName}`)
490 console.log(`Repository URL: ${repoUrl}`)
491 console.log(`Commit limit: ${limit}`)
492
493 // Setup the test repository
494 console.log('Cloning repository...')
495 const repoPath = await setupTestRepo(repoUrl, repoName)
496
497 // Get commits
498 if (afterCommit) {
499 console.log(`Fetching ${limit} commits after ${afterCommit}...`)
500 } else {
501 console.log(`Fetching last ${limit} commits...`)
502 }
503 const allCommits = getCommits(repoPath, limit, afterCommit)
504 console.log(`Found ${allCommits.length} commits`)
505
506 // Apply basic filtering
507 console.log('Applying basic filters...')
508 const filteredCommits = basicFilter(allCommits)
509 console.log(
510 `${filteredCommits.length} commits remaining after basic filtering`,
511 )
512
513 if (filteredCommits.length === 0) {
514 console.log('No commits passed basic filtering. Exiting.')
515 return
516 }
517
518 // Screen commits with GPT-5
519 console.log('Screening commits with GPT-5...')
520 const selectedCommits = await screenCommitsWithGpt5(
521 filteredCommits,
522 repoUrl,
523 repoPath,
524 clientSessionId,
525 )
526 console.log(`\nFinal selection: ${selectedCommits.length} commits`)
527
528 // Create result object
529 const result: CommitPickerResult = {
530 repoUrl,
531 repoName,
532 generationDate: new Date().toISOString(),

Callers 2

generateRepoEvalV2Function · 0.90
pick-commits.tsFile · 0.85

Calls 5

extractRepoNameFromUrlFunction · 0.90
setupTestRepoFunction · 0.90
getCommitsFunction · 0.85
basicFilterFunction · 0.85
screenCommitsWithGpt5Function · 0.85

Tested by

no test coverage detected