feat: add extraExcludes parameter to getGitDiff#2
Open
Alok650 wants to merge 3 commits into
Open
Conversation
5923b83 to
75c0bd2
Compare
|
DocSync detected doc sections that may need updating. File: - *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 |
Owner
Author
|
/docsync apply getGitDiff |
Owner
Author
|
/docsync apply DocSyncConfig |
| const excludes = [AUTODOCS_DIR, ...extraExcludes] | ||
| .map(p => `':(exclude)${p}'`) | ||
| .join(' ') | ||
| const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
extraExcludesparameter togetGitDiffso 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
getGitDiffnow acceptsextraExcludes: string[](defaults to[]).autodocs/exclude and joined into a singlegit diffcommand