Unless you are spearfishing, as a diver you are very unlikely to run into an unwanted dangerous situation. If you are spearfishing, dumping your catch will generally give them what they want.
If, like me, you have encountered sharks on purpose by baiting the water, you'll notice that generally they are very measured in their approach. They know what they want, and you aren't it. If they do get closer than you like, let them bump into something that puts them off. If you have a large camera rig like me, that does the trick. If not, a metre long plastic stick, held so that they bump into the side of it, also works. They seem to regard it as something quite large. If you poke them with the end of it however, it is a very small surface, and merely seems to cause the nictitating membrane to roll over their eye, and a bite response to follow.
I only have experience with tigers, bulls, great hammerheads, oceanic whitetips, and the more docile species.
Great whites are a different matter. I don't mean by that that they are psychotic monsters, but their size makes the difference. If you encounter one as a diver by chance, and you are not spearing, it will almost certainly just cruise on by, and you can count that as one of your best encounters. If it makes a mistake, and you get caught in an attack, you would be lucky to get a punch, poke, prod or anything else to find the target. They are big fish, and a test bite will damage you.
Luckily, it doesn't happen very often. More people are killed by dogs every year than have ever been killed by sharks.
Now how the hell do you stop a mad chihuahua?
David