0

Given a SHA hash of a merge commit, is there a way to determine what merge strategy (parameter passed to git merge as -s or --strategy) was used when it was created?

I was able to figure it out by retrying the same merge with different resolution strategies until I got the same conflicts, but I figure there must be better way to do it.

I am trying to examine a problem where the change got overwritten by a merge commit, similar to this question.

Andrey Makarov
  • 1,026
  • 1
  • 10
  • 12
  • A merge conflict could be resolved manually without using any Git internal strategy. – ElpieKay Oct 13 '17 at 09:39
  • Sorry for the confusion, I used the wrong term. I meant the merge strategy (the one passed as `-s` parameter to git merge command), not conflict resolution strategy. I will edit the question, so it uses correct terminology. – Andrey Makarov Oct 13 '17 at 12:23
  • I meant "merge strategy". Because it could have been done without any internal strategy, it's hard to tell which strategy it is from the result. The committer may have done it manually. – ElpieKay Oct 13 '17 at 12:31
  • No—but that's not necessarily the right question anyway, since Git is (intended to be) about content (i.e., results) rather than process (e.g., some particular sequence of commands). If you get the same merge result from strategy `$S` with arguments `$A`, does it really matter whether the other guy specifically used that strategy with those arguments? (Maybe it does, maybe it doesn't, depending on the problem at hand.) – torek Oct 13 '17 at 15:14
  • I agree that if the end result is the same then the exact commands do not matter. But if git stores strategy inside merge commit, then i'd like to know that, because it will save me some time figuring out what was done and why another commit got overwritten. – Andrey Makarov Oct 16 '17 at 07:33

0 Answers0