"He accepts responsibility for completely losing the plot," Mr Westgate said.
MacGillivray had pleaded guilty. He was very unlikely to reoffend and had no previous convictions, Mr Westgate told Judge John Macdonald.
The police summary said a two-year relationship between MacGillivray and his former partner ended on October 15.
About 5.15am on October 18, MacGillivray drove to a South Dunedin address, where his former partner and her new partner were present. He got out of his vehicle and, with a cricket bat, damaged a Holden vehicle the woman's new partner had been using.
The new partner came outside to confront him but retreated and locked the door when MacGillivray charged at him. MacGillivray struck the front door with the cricket bat, smashing the glass pane.
He then did more damage to the Holden before driving off. Soon after, police saw him drive past the South Dunedin address and signalled him to stop. He did not but accelerated heavily, reaching an estimated speed of 120km/h in a 50km/h zone before disappearing out of sight.
About 7.15am, MacGillivray sent a Facebook message saying he was going to the new partner's home in Green Island. The victims of the earlier incident arrived there about 7.30am and saw him stop near the house.
There was a further incident in which MacGillivray again used the cricket bat, resulting in the victims fleeing into a garage. When he left, the victims called police.
In Green Island, about 8.15am, police noticed him driving and again signalled him to stop. But he again accelerated, reaching an estimated 80km/h in a 50km/h posted area busy with commuters and schoolchildren.
In Main South Rd, nearing the intersection with Quarry Rd, he drove on the left footpath for about 30m before directing his vehicle into a power pole, causing his vehicle to go over a 3m-4m bank and land on its roof. The power pole was split in half by the impact.
MacGillivray was taken to hospital and discharged the same day. Judge Macdonald noted MacGillivray was a first offender and that the offending was directly linked to the turmoil in his life when his relationship ended.
Also noting MacGillivray had spent just over three weeks in custody, he told him "you have only yourself to blame because you breached your bail conditions".
MacGillivray's community detention curfew is 6pm-6am daily; he is to pay $160 reparation for damage to the door; and there is a protection order against him in favour of his former partner.