You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fails to parse diffs generated by git format-patch
Which, I guess, is understandable considering that none of this is part of the Unified Format specification.
A feature to strip the file path prefixes from git diffs is already present, but these issues persist. Some options to fix this:
Preprocess the diff similarly to how it's done for stripping the file path prefixes. For this, you'd have to: 1. remove all \ No newline at end of file lines for git diffs, 2. replace rename from and rename to lines with respective hunks for adding and removing all the lines from each of the files (not sure if this will properly remove the old files?) for git diffs, and 3. add a new PatchSource variant called GitMailbox or something, which does everything that GithubPrDiff does (which could use a rename to just GitDiff or something btw) in addition to removing, from a given patch file, all lines before the diff --git one, and the last three lines respectively containing --, the version of git used to generate the patch, and nothing.
Fork the upstream crate, call it gitpatch or something, and add proper support for all of this stuff. (You could probably remove the PatchSource thing altogether if you add proper autodetection for these kinds of diffs) Not sure if the upstream person will respond to any PRs, or if they care to add this sort of thing.
Just don't fix it and add a note to the readme to use diff -u instead of git. Which I would recommend against as most people will probably want to use git diffs, but, not my crate. I guess you could also not add support for git format-patch diffs but fix the other stuff, though those kinds of diffs are what I'm more interested in personally.
The text was updated successfully, but these errors were encountered:
The crate this program relies on to parse diffs:
git format-patch
Which, I guess, is understandable considering that none of this is part of the Unified Format specification.
A feature to strip the file path prefixes from git diffs is already present, but these issues persist. Some options to fix this:
\ No newline at end of file
lines for git diffs, 2. replacerename from
andrename to
lines with respective hunks for adding and removing all the lines from each of the files (not sure if this will properly remove the old files?) for git diffs, and 3. add a newPatchSource
variant calledGitMailbox
or something, which does everything thatGithubPrDiff
does (which could use a rename to justGitDiff
or something btw) in addition to removing, from a given patch file, all lines before thediff --git
one, and the last three lines respectively containing--
, the version of git used to generate the patch, and nothing.gitpatch
or something, and add proper support for all of this stuff. (You could probably remove thePatchSource
thing altogether if you add proper autodetection for these kinds of diffs) Not sure if the upstream person will respond to any PRs, or if they care to add this sort of thing.diff -u
instead of git. Which I would recommend against as most people will probably want to use git diffs, but, not my crate. I guess you could also not add support forgit format-patch
diffs but fix the other stuff, though those kinds of diffs are what I'm more interested in personally.The text was updated successfully, but these errors were encountered: