In MergeCommand, the following Ref is created for an include as above:

new ObjectIdRef.Unpeeled(Storage.LOOSE, name, commit.copy())

The problem is, how can MergeMessageFormatter distinguish this case from the case where just a SHA1 was specified to be merged?

AFAICS, EGit can't yet merge a commit directly, only a branch. I don't know what the Ref is going to be for a SHA1-referenced commit.