Skip to content

Use patch instead of git apply #151

@dinosaure

Description

@dinosaure

See dinosaure/esperanto#52 for more context.

It appears that git apply makes quite a few assumptions about how the project is organised and whether or not it is a Git repository. During my research, I found that quite a few people were having problems with git apply for obscure reasons related to folders, whether or not they were in a Git repository, and possible correlations between .git/index (which tracks all files in the Git repository) and patches.
In short, it is quite "easy" to encounter a situation where git apply does not want to apply the patches for a multitude of reasons other than the fact that the patch cannot be applied.

For all these reasons (and the time spent by myself and @shym on this specific problem), it may be more interesting to use patch rather than git apply when applying patches to OCaml. Currently, patches are generated by git diff and are Git patches that are incompatible with patch, but it should not be difficult to modify the patches accordingly so that they are understood by patch.

The advantage is that patch is a little more predictable than git apply and does not require obscure information such as the .git/index or the fact that we are in a Git repository.

I have already encountered some problems in modifying and improving ocaml-solo5 and its workflow, specifically in this area. I didn't have time to pinpoint the issue at the time, but now I have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions