ichi is right, of course.
as per Froggy's guide (do read that, it's excellent),
it makes most sense to keep spears and pikes on hold formation, because of the significant bonus they get.
besides, you want spears/pikes to hold your line.

swords don't get any formation bonus (ok, they get +1 attack I think, but that's really irrelevant), so it's probably worth it to have all of them fight and kill the enemy than to have a bunch of swordsmen with a +1 bonus that are standing idle, using their swords to pick their noses.
this is whenever you're using swords to attack, rather than hold the line (which is most of the time, at least in SP).

however, polearms don't get the formation bonus that spears and pikes do, and as Froggy again brilliantly illustrated, they cause a lot more damage when they spread within the enemy's ranks. There's no gain in keeping them in formation, you want them to cause damage and for as many of them to get into the carnage as possible. So don't keep them in hold formation.

i hope this makes some sense.