Is there a way I can prevent git from auto-merging AssemblyInfo.cs (or disbling its behavior of detecting "oh, it's the same change, I can skip it")? If I increased the version the same way in two branches, and then merging both, I would like to handle this as conflict.
I start off in branch master with
[assembly: AssemblyVersion("1.1.*")]
Then I create two branches A and B, making changes to the project. In both branches, I change the AssemblyVersion
[assembly: AssemblyVersion("1.2.*")]
Now I merge branch A, then branch B. When merging branch B, git doesn't even consider this as conflict, since both commits make the same change.
Example:
git init Bar
cd Bar
echo '[assembly: AssemblyVersion("1.1.*")]' > AssemblyVersion.cs
git add AssemblyVersion.cs
git commit -m "Initial commit"
git checkout -b branchA master
echo -e "class A\n{\n}" > ClassA.cs
git add ClassA.cs
echo '[assembly: AssemblyVersion("1.2.*")]' > AssemblyVersion.cs
git commit -a -m "Add class A"
git checkout -b branchB master
echo -e "class B\n{\n}" > ClassB.cs
git add ClassB.cs
echo '[assembly: AssemblyVersion("1.2.*")]' > AssemblyVersion.cs
git commit -a -m "Add class B"
git checkout master
git merge --no-ff branchA -m "Merge Branch A"
git checkout master
git merge --no-ff branchB -m "Merge Branch B"
A custom merge filter won't work, since this is only executed on a three-way-merge.
Is there a solution to this?