parse-git-diff
parse-git-diff copied to clipboard
parse git diff
It might improve the performances to use a `Generator` when reading big files. I just added an overide function which allow this ```ts export default function parseGitDiff( diff: Generator, options?:...
Need to add test cases to check if it can handle various Git Diff outputs. - https://github.com/git/git/tree/master/t/t4135
```raw diff --cc README.md index 2445f65,f4b8569..0000000 --- a/README.md +++ b/README.md @@@ -8,7 -8,7 +8,11 @@@ npm install parse-git-diff ... ```
Here's a test case: ```js import parseGitDiff from 'parse-git-diff' const diffOutput = `diff --git a/var/folders/kt/zd3bfncd0c3gjx25hbcq483c0000gn/T/epicshop/diff/advanced-react-apis/04.01.solution/7h2jowvfi2q/index.test.tsx b/var/folders/kt/zd3bfncd0c3gjx25hbcq483c0000gn/T/epicshop/diff/advanced-react-apis/04.01.solution/7h2jowvfi2q/index.test.tsx new file mode 100644 index 0000000..e69de29 diff --git a/var/folders/kt/zd3bfncd0c3gjx25hbcq483c0000gn/T/epicshop/diff/advanced-react-apis/04.01.problem/7h2jowvfi2q/index.tsx b/var/folders/kt/zd3bfncd0c3gjx25hbcq483c0000gn/T/epicshop/diff/advanced-react-apis/04.01.solution/7h2jowvfi2q/index.tsx index 9913856..4d68325 100644 ---...
See https://github.com/parkerbxyz/suggest-changes/issues/50#issuecomment-2833593729 The TLDR is that it seems like parse-git-diff can handle `@@ -74,2 +74 @@`, but for 1 line changes git will omit the `,1` and just report `@@...
https://docs.gitlab.com/api/repositories/#compare-branches-tags-or-commits Example response: ```json { "commit": { "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", "short_id": "12d65c8dd2b", "title": "JS fix", "author_name": "Example User", "author_email": "[email protected]", "created_at": "2014-02-27T10:27:00+02:00" }, "commits": [{ "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", "short_id": "12d65c8dd2b", "title": "JS...