Gregor Townsend's tenure as Glasgow Warriors head coach ended with defeat by Edinburgh

Gregor Townsend's time as coach of Glasgow Warriors came to an end on Saturday after five years and 147 games. It ended in sunshine and noise and on-field tributes - and defeat.

This damp squib, a meek loss to struggling rivals Edinburgh, was not the farewell he wanted nor the one his players wanted to give him ahead of his switch to the national side. At the end of a tumultuous era, this was the flattest of finales.

The other day, he reminisced about his time with the Warriors and, more specifically, his early weeks. There were no sold-out stadiums back then, no great reason to believe that Glasgow would move forward in the way they have over the span of the Townsend years.

An uncertain dawn

Townsend came into Glasgow under a cloud, replacing the popular Sean Lineen, who'd taken the side to two Pro12 play-offs in the previous three seasons. Townsend had been attack coach for Scotland, a team that had no discernible attack.

His arrival at Scotstoun, therefore, was not heralded as a bright new dawn. His first game as head coach was a pre-season friendly against Castres in the south of France. Glasgow lost 20-17.

His second was another friendly, against Sale at Heywood Road. They lost that one, too - 49-27. Glasgow played a third challenge match before the Pro12 season began - against Exeter at Millbrae. Another defeat - 15-6.

Then the Pro12 started and Glasgow went to Ulster in week one - and lost a fourth straight game. Next up were the Scarlets at Glasgow's new home at Scotstoun and Townsend hit on an idea which he tried to sell to his players.

"We'd come off the back of those defeats and we were four in a row," said Townsend. "I tried to do a couple of things and I look back now and they were gimmicks.

Prior to Saturday's defeat, Gregor Townsend had won 91 of 146 games as Glasgow coach

"Our first home game - I got this brick and I talked about the Great Wall of China and how one of the emperors had built a section of the wall with 999,999 bricks and he kept the millionth brick just to remind people what it took to build this fortress.

"I had a brick and was using all these metaphors and analogies about how this - Scotstoun - was going to be our fortress - and then we went out and lost to the Scarlets, so the brick was thrown in the bin after that. It was a lesson for me - just be yourself."

Glasgow gather pace - and panache

Townsend found his feet soon enough. Glasgow won their next six matches, lost two and then won another seven on the spin. They played with ambition. They entertained.

In Stuart Hogg, DTH van der Merwe, Sean Maitland, Tommy Seymour and the new cult hero, Niko Matawalu, they had marquee players coming out of their ears. That group scored 32 tries between them that season.

Free-spirited Fijian Niko Matawalu became a darling of the Scotstoun support

Glasgow outscored every other team in the Pro12 and only hit the wall when they lost by two points in the semi-final to Leinster, who went on to win both the league and the Heineken Cup.

That 'Great Wall of China' game against the Scarlets at the start of the season drew a crowd of 4,348. Their last home game of the season, against the Ospreys, brought in 6,642.

Those numbers would not have registered among the Munsters and the Leinsters and the Ulsters with their vast support, but knocking on for 7,000 people for a rugby match in a football city was a sign of a gathering momentum, on the pitch and off it.

A human sponge with a brutal edge

Townsend drove a lot of it. Tim Swinson tells a story about trips on the road with Glasgow. The travelling party sit in alphabetical order, so Swinson was always in the same row of the plane as Townsend. Every trip he'd notice his coach reading a new book about a high-achieving coach or club.

An autobiography of an iconic leader from American college basketball, a biography of an American football coaching behemoth, a history of Barcelona (whose academy he visited and whose culture he was fascinated by).

Townsend reveres legendary basketball coach, Dean Smith

His favourite was The Carolina Way: Leadership Lessons from a life in coaching. It was written by Dean Smith, the late veteran coach of the University of North Carolina basketball team. Townsend became a human sponge for that stuff.

Glasgow added quality as they went along. Townsend introduced Jonny Gray from the academy and found Leone Nakarawa from the Fijian Army side. Piece by piece a jigsaw was being put together.

He was also brutally tough at times. By his own admission, Hogg lost the run of himself in that 2013-14 season. He became a Lion in the summer of 2013 and crossed the border from confidence into arrogance in the wake of it. Townsend didn't like his attitude.

Full-back Stuart Hogg marked his 100th Glasgow appearance with a try in the defeat by Edinburgh

When he gave him a shot at redemption, against Zebre, he still didn't like what he was seeing and took Hogg off at half-time despite the fact the full-back had scored two tries. Hogg didn't kick another ball for Townsend until the following season.

Scotland's first champion

He missed the Pro12 semi-final, a nerve-shredding victory over Munster at Scotstoun in front of a record crowd of 10,000. He was kept in the stand for the final, too. Even though they lost the showpiece heavily to Leinster in Dublin, Glasgow were entering new territory - they were now attracting more than just rugby diehards.

A game at Scotstoun became a social occasion, a part of a night out for people who never watched rugby before, but who went and enjoyed the vibe. It was noticeable that more kids started going. It didn't happen by accident. This was how the remarkable rise of the Irish provinces began. Townsend, and everybody in the Glasgow organisation plus Mark Dodson in the SRU, were acutely aware of that.

The Pro12 win against Munster in Belfast was the end of stage one of the Townsend and Glasgow story. It wasn't just that they beat Munster in that final, it was how they beat them.

Townsend guided Glasgow to the 2015 Pro12 title - the first piece of silverware won by a Scottish professional club

They played with elan from the get-go and played Munster off the park. Nakarawa and his telescopic arms off-loading out of the tackle. Hogg reborn as a focused and attacking wonder. Finn Russell and Jonny Gray emerging as international-class players. It was a joyous performance.

These were otherwise desperately grim times for Scottish rugby. What optimism existed in the sport largely came from Scotstoun. The Warriors were the beacon of light in a dark time until Vern Cotter's team got some traction - with many of Glasgow's players, all nurtured by Townsend.

Unprecedented success brings fresh challenges

With success came a problem. Glasgow were always a key supplier of players to the international team, but now they became a factory. It's hard to think of a side in world rugby that is as decimated by the international window as Glasgow. You pay a price for that eventually.

This season, there were 13 Glasgow players (nine starters and four replacements) in the Scotland squad that beat Ireland in the Six Nations. In the victory over Wales, there were 10 starters and three substitutes.

Through those Six Nations championship weeks - and the November Test series - Glasgow played six Pro12 matches without their international players and lost five of them. They just couldn't build the squad depth to paper over the cracks this time around.

Glasgow are bereft of swathes of Scotland internationals during Test windows, including (from left to right) Tommy Seymour, Alex Dunbar and Fraser Brown

Townsend strived for progress in Europe. Before this season he was caught in a loop of one step forwards and two steps back. The dream of a place in the last eight came down to this season - his last chance. He said recently that had the team not done it on his watch then he would have left Scotstoun as an unfulfilled coach.

It took five attempts, but they got over the line. Having already taken care of Leicester at home and Racing at home and away they needed a win at Welford Road to make the knockouts. They stormed through with a startling 43-0 triumph.

The quarter-final against Saracens was another chapter in Townsend's education. He locked himself in a bunker and prepared meticulously. He says he over-emphasised - perhaps even obsessed - on Saracens and how to stop them rather than getting Glasgow just to play their own game.

He blames himself for Glasgow's heavy loss in front of a travelling support of 6,000, an extraordinary number. The season before Townsend was appointed as coach Glasgow failed four times to break 3,000 for a home Pro12 match and only twice broke 5,000. Their average attendance was 4,018. Now they took 6,000 on the road and average over 7,000 at home. There's talk of increasing the capacity of Scotstoun to 10,000.

Saracens brushed Glasgow aside in the European Champions Cup quarter-final

"Nothing might have worked, because Saracens are so good, but I got it wrong," he said, candidly of the quarter-final.

He can move into his new job knowing that in five years there weren't many occasions when his judgement was found wanting. In so many ways he raised the bar. Now it's Dave Rennie's turn to raise it higher.