as AnonymAnonym said in comments
Short Shrift was a shrift given to prisoners about to be executed. It was often brief and clumsy, not in accordance with the usual practices, and thus short.
It was brief time for confession or absolution given to a condemned prisoner before his or her execution.