Francis Mackenzie felled Gerald Kenney with a two-handed hammer blow to the head before he and others continued to assault the victim on the ground.
Mackenzie, 47, continued to rain down blows on Mr Kenney with the weapon.
He repeatedly struck him on the head with six or seven blows and one eyewitness saw the victim's skull give way as he was attacked.
The victim had been walking his dog in Tollcross Road, Glasgow, when he was approached from behind by his assailants.
A judge told Mackenzie at the High Court in Edinburgh that he was satisfied that he should make an Order for Lifelong Restriction in his case.
Lord Turnbull said: "You are an adult man with a lengthy history of criminal conduct which includes a number of convictions for assault. Of most significance in 2000 you were sentenced to 10 years for your responsibility in taking another man's life."
The judge said it was surprising that the victim in the latest offence did not die.
Lord Turnbull ordered that Mackenzie must serve three years and nine months before he becomes eligible to apply for parole. If freed by parole authorities he will be under continuing supervision.
But the judge told him: "I wish to stress to you this does not reflect the period which I think you should serve in custody."
"Whether you will ever be released on licence and, if so, at what point will be a matter exclusively for the Parole Board," he said.
Mackenzie, who has a previous conviction for culpable homicide, had earlier admitted attempting to murder Mr Kenney in the attack on June 12 last year.