last-commit-log icon indicating copy to clipboard operation
last-commit-log copied to clipboard

line-diff.js give ENOBUFF for execSync command for large diffs

Open lorranmira opened this issue 3 years ago • 1 comments

Hi, Is is possible to update the use of execSync in line-diff.js to match how it is used in index.js? Currently it appears to use the default value for maxBuffer

lorranmira avatar Aug 09 '22 02:08 lorranmira

@lorranmira I am also running into the same issue, it would be nice to have the option to add options to the git diff command used in line-diff.js to allow for filtering, I am going to submit a PR to deal with this issue to allow for sending an additional option at the end to allow for filtering. A use-case for this would be to remove generated files from the diff you could use the following syntax to filter

here is the command we would like

git diff -xyzOptions -- *.{ts,js,<any-other-accepting-glob>}

and this will allow us to not accept generated files such as yarn.lock, *.json, etc

Feel free to comment on any suggestions to how this might be implemented

If you are looking for a temporary solution

you can use the currentBranch flag to carry out the command you would like by simply appending it an example being:

diff({
    currentBranch = "HEAD -- *.ts"
});

atidyshirt avatar Aug 16 '22 04:08 atidyshirt