When we first saw Luke in TFA was he about to kill himself and Rey showing up prevented it?
He is standing in his Jedi robes on the edge of a cliff and Rey shows up. He takes the saber, throws it over his shoulder. He immediately walks away and goes into his hut. The first thing he seemingly does when going into his hut is take off his Jedi robes and change into the brown sorta raggy clothes he wears most of the rest of the movie. Not only that but he seems to put his Jedi robes away with great care.
The next time we see him wearing his Jedi robes is when he is about to burn down the tree and the books. He tells Yoda "Im going to end all of this". Well just burning down the tree won't end it, not if Luke is still alive. The Jed religion would still be alive within in.
My thinking is this, Luke was going to kill himself when Rey showed up. He was again going to kill himself when Yoda's ghost showed up. The Jedi robes represent what Luke wants to be remembered as, the good Luke so to speak. He puts those robes on to die in.