Skip to content

Simple language special cases #51

@yairchu

Description

@yairchu

In some languages, especially configuration files, there are special cases which are easy to auto-merge.

For example a Python requirements.txt file can have:

<<<<<<< HEAD
numpy==1.4
git+https://github.com/foo/bar.git@BBB
||||||| parent of ...
numpy==1.4
git+https://github.com/foo/bar.git@AAA
=======
numpy==2.0
git+https://github.com/foo/bar.git@AAA
>>>>>>> 10ccf9c (feat: updated cztwrap that includes rfft)

We can match the first lines by them all starting with numpy== and thus splitting them to a separate conflict, and then both of the conflicts become trivial.

Other cases:

  • Imports in various languages (but not C/C++ #includes whose order matter!)
  • Haskell
    • LANGUAGE pragmas
    • newtype in base turning into data in both A and B should split the conflict on its line
    • Split function conflicts on type declaration, LHS, & RHS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions