Skip to content

feat: add extraExcludes parameter to getGitDiff#2

Open
Alok650 wants to merge 3 commits into
mainfrom
extend-git-diff-options
Open

feat: add extraExcludes parameter to getGitDiff#2
Alok650 wants to merge 3 commits into
mainfrom
extend-git-diff-options

Conversation

@Alok650

@Alok650 Alok650 commented May 3, 2026

Copy link
Copy Markdown
Owner

Adds an optional extraExcludes parameter to getGitDiff so callers can pass additional pathspec exclusions alongside the built-in .autodocs/ exclusion. Useful for repos that want to exclude generated files, vendored directories, or large binary assets from the diff analysis.

Changes

  • getGitDiff now accepts extraExcludes: string[] (defaults to [])
  • Exclusions are combined with the built-in .autodocs/ exclude and joined into a single git diff command

@Alok650 Alok650 force-pushed the extend-git-diff-options branch from 5923b83 to 75c0bd2 Compare May 3, 2026 18:16
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

DocSync detected doc sections that may need updating.

File: docs/api.md#### getGitDiff

- *function*
- 
- Runs `git diff` between the specified `base` ref and `HEAD` within `repoDir`, excluding the auto-generated docs directory from the comparison, and returns the parsed result as an array of `ChangedFile` objects. Accepts the repository directory path and an optional base ref that defaults to `GIT.DEFAULT_BASE_REF`. The raw diff output is passed to `parseGitDiff` to produce the structured return value.
+ Runs `git diff` between the specified `base` ref and `HEAD` within `repoDir`, excluding the auto-generated docs directory and any additional paths provided via `extraExcludes` from the comparison, and returns the parsed result as an array of `ChangedFile` objects. Accepts the repository directory path, an optional base ref that defaults to `GIT.DEFAULT_BASE_REF`, and an optional array of extra exclude patterns that defaults to an empty array. The raw diff output is passed to `parseGitDiff` to produce the structured return value.

To apply: comment /docsync apply getGitDiff — or dismiss with /docsync dismiss.

@Alok650

Alok650 commented May 3, 2026

Copy link
Copy Markdown
Owner Author

/docsync apply getGitDiff

Comment thread src/differ/git-differ.ts Fixed
@Alok650

Alok650 commented May 4, 2026

Copy link
Copy Markdown
Owner Author

/docsync apply DocSyncConfig

Comment thread src/differ/git-differ.ts
const excludes = [AUTODOCS_DIR, ...extraExcludes]
.map(p => `':(exclude)${p}'`)
.join(' ')
const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants