Skip to content

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"; "--";

@kit-ty-kate
Copy link
Member Author

Superseded by #5892 which i'm hoping to finish whenever the patch library is ready

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