Strip whitespace from spec fields
Sometimes people make typos or leave extra whitespace after a value. E.g.
'rcrev 3 '. Make sure to strip it off so the string we eventually pass
to git isn't taken literally as e.g. 'v4.6-rc3 ' because it freaks out.
Also clean up the assignments a little bit.