If the merge out to the FROM branch was performed after all merge in operations, then the merge is eligible to be trivial. If it is not, then the merge cannot be trivial. Here are some notes on implementing any kind of trivial merge detection. Obtaining Information First, the most common thing that needs to be done in any trivial merge detection algorithm is determine the predecessor of a given version. The meat of any trivial merge detection algorithm is determining whether a given version is an ancestor of another version.
Y are the same, then if version m is less than or equal to version n , ancestry is proven.
Otherwise, ancestry is disproven. Y are not the same, then find the version of Y which is on branch X . Compare this with the possible ancestor as in the previous step.