Skip to content

Commit 34cae7b

Browse files
xperiandriclaude
andcommitted
fix(git): merge project files as text, without the union driver
`.gitattributes` gave `*.fsproj`, `*.csproj`, `*.vbproj`, `*.dbproj` and `*.sln` the merge driver `union`. That driver reports no conflict: where two branches change the same lines, it keeps the lines of both. A branch that replaces a legacy file deletes the `<Compile>` line of the file, and the union brought the line back, or listed a file twice, when another branch had changed the lines next to it. The project of `feat/queue` merged with `feat/stack` listed `Stack.fs` and `Queue.fs`, which neither branch has any more, and the build failed with FS0225. Three of sixteen pairs of the open branches merged into such a project. Without the driver these merges stop at a conflict in the project file, which is resolved together with the other conflicts of the merge. F# compiles the files in the order of the project file, so the merged order needs that look. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 140e532 commit 34cae7b

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎.gitattributes‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
*.fs diff=csharp text=auto eol=lf
88
*.fsi diff=csharp text=auto eol=lf
99
*.fsx diff=csharp text=auto eol=lf
10-
*.sln text eol=crlf merge=union
11-
*.csproj merge=union
12-
*.vbproj merge=union
13-
*.fsproj merge=union
14-
*.dbproj merge=union
10+
*.sln text eol=crlf
11+
# No `merge=union` for project files. The union driver reports no conflict and keeps the lines of both sides, so a line
12+
# that one branch deleted comes back, and F# compiles the files in the order of the project file
1513
*.sh text eol=lf
1614
# cmd.exe misreads labels and goto in LF batch files
1715
*.cmd text eol=crlf

0 commit comments

Comments
 (0)