I don't get how this is still a discussion.
https://en.wikipedia.org/wiki/Energy_density
One kilogram of diesel has 13 KWh of energy.
One kilogram of hydrogen contains approximately 39 KWh of energy.
Buuuut... even with perfect electrolysis, you are consuming that *same*39 KWh to produce that one kilogram of hydrogen. More practically, at least double that, due to inefficiency.
https://en.wikipedia.org/wiki/Electrolysis_of_water
Remember, oxygen doesn't count. It doesn't provide power. And most of the weight of water is oxygen. Only a little over 1/10th of your water is hydrogen, by weight. Which means you would have to carry four times as much water as diesel for this, and an expensive EV battery pack, as on the Leaf, would not be enough to electrolyze more than a few liters of water.
In other words, just stick to an electric motor. Cheaper, safer, more efficient.