From 75c0bd2f266e867e836d4133ed366fa84272ac78 Mon Sep 17 00:00:00 2001 From: Alok Date: Sun, 3 May 2026 23:37:53 +0530 Subject: [PATCH 1/2] feat: add extraExcludes parameter to getGitDiff --- dist/cli.js | 5 +++-- dist/index.js | 5 +++-- src/differ/git-differ.ts | 12 +++++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dist/cli.js b/dist/cli.js index 54d4ea3..56b8697 100755 --- a/dist/cli.js +++ b/dist/cli.js @@ -12624,8 +12624,9 @@ function parseGitDiff(diffOutput) { } return files; } -function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF) { - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF, extraExcludes = []) { + const excludes = [AUTODOCS_DIR, ...extraExcludes].map((p) => `':(exclude)${p}'`).join(" "); + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: "utf-8", maxBuffer: MAX_DIFF_BYTES diff --git a/dist/index.js b/dist/index.js index a235caf..768811f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5453,8 +5453,9 @@ function parseGitDiff(diffOutput) { } return files; } -function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF) { - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF, extraExcludes = []) { + const excludes = [AUTODOCS_DIR, ...extraExcludes].map((p) => `':(exclude)${p}'`).join(" "); + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: "utf-8", maxBuffer: MAX_DIFF_BYTES diff --git a/src/differ/git-differ.ts b/src/differ/git-differ.ts index ff9b0ae..a6d432d 100644 --- a/src/differ/git-differ.ts +++ b/src/differ/git-differ.ts @@ -34,9 +34,15 @@ export function parseGitDiff(diffOutput: string): ChangedFile[] { return files } -export function getGitDiff(repoDir: string, base = GIT.DEFAULT_BASE_REF): ChangedFile[] { - // Exclude the generated index dir so its churn never triggers doc updates. - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +export function getGitDiff( + repoDir: string, + base = GIT.DEFAULT_BASE_REF, + extraExcludes: string[] = [], +): ChangedFile[] { + const excludes = [AUTODOCS_DIR, ...extraExcludes] + .map(p => `':(exclude)${p}'`) + .join(' ') + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: 'utf-8', maxBuffer: MAX_DIFF_BYTES, From 073a58cddb9ff624dfe5fc8c70ed9b25dea55c3c Mon Sep 17 00:00:00 2001 From: Alok Date: Tue, 5 May 2026 00:20:47 +0530 Subject: [PATCH 2/2] chore: trigger docsync check