Synchronizing a diesel generator with a pure sine wave inverter
First, you have to control one of the sources. I don't think there is anything to do about power network, but you must be able to control the diesel. There should be some throttle something. 

Actually, it could be a very nice control project. You should measure the phase and by changing throttle keep the phase error zero. Like a diesel PLL. 

But a more practical way is to convert the diesel output to DC and then with an invertor just create any sine wave you want.