I just realized that Git is ignoring whitespaces during merge by default. However, I would like that Git would consider whitespace during merge. Is there someone that knows how can I configure it?
I tried to install older versions, but I could not find. The steps to install older version on Ubuntu would be nice.
2
Answers
I just realized that Git is using a new strategy, named ort, and this was generating a different result that allows the context of conflicting chunks also would change during the merge (it is described in the documentation https://git-scm.com/docs/git-merge). However I used this fact (context lines do not change) in my algorithm. Thus, I changed the strategy to recursive (-s recursive) and this resolved my problem.
I replayed the merge 044a3c of SAIM (https://github.com/dice-group/SAIM) and I had two different answers. Unfortunately, there is no space to show the results in this answer and I will show the first conflicting chunk reported for each strategy.
Ort strategy
Recursive strategy
I'm not judging which is the better result, just the one that works for the algorithm I implemented.
Thanks!
Gleiph
Git should not ignore whitespace during merges, unless:
-Xignore-all-space
(man page)git merge
would not)The OP GLEIPH GHIOTTO LIMA DE MENEZES confirms in the comments it is because of a merge driver which does not work well with the new merge default strategy ORT, resulting in a different context for
diff
.Using
merge -s recursive
is enough for now to revert to the legacy behaviour.