Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use git diff instead of the system diff command #5894

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Member

opam already harbour a patch parser used to preprocess CRLF in patch files. As (yet another) alternative to #5892 and #5893 we can take advantage of this preprocessing and output the files that we detect are going to be deleted.

This can only happen if the format in the given patch file is parseable, this is too tricky to do with the system diff commands (see hannesm/patch#8) without a robust date parser so instead we can use git diff --no-index when we control the input patch (during opam update). When that's the case, we delete the empty straggler files after the application of the patch that we were able to detect.

This makes the system patch command on macOS usable when packages have been deleted from an opam repository.

See #5891
Fixes #3639

"diff"
[ "-ruaN";
"git"
[ "diff"; "--no-index"; "-a"; "--";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ "diff"; "--no-index"; "-a"; "--";
[ "diff"; "--no-index"; "--no-renames"; "-a"; "--";

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.

Could not update local repository on mac
1 participant