Then Oak laughed, and Bathsheba smiled, for she never laughed readily now; and their friends turned to go.
"Yes, I suppose that's the size o't," said Joseph Poorgrass with a cheerful sigh as they moved away; "and I wish him joy o'her; though I were once or twice upon saying to-day with holy Hosea in my Scripture manner which is my second nature, 'Ephraim is joined to idols: let him alone.' But since 'tis as 'tis, why it might have been worse, and I feel my thanks accordingly." (57.51-52)
Like a lot of comedies, Far from the Madding Crowd ends with a wedding between two lovers who've always belonged together. Hardy puts a sober spin on this kind of ending, though, when he reminds us that Bathsheba likes Gabriel more than loves him.
On top of that, we notice that the narrator is quick to tell us that Bathsheba isn't ready to laugh with joy at what's happened, since her experiences have hardened her to the point that she doesn't feel much pleasure anymore.
Hardy also decided to end the book with a comment from the rural worker, Joseph Poorgrass. Poorgrass always has a tendency to misquote the Bible in this book, and he does so again here. The passage he's trying to quote is Hosea 4:17, which refers to the tribe of Ephraim being idol-worshippers. But poor Poorgrass uses this quote as if it's an appropriate thing to say at a wedding.
This ending is definitely bittersweet, even with Poorgrass clowning around. The happy couple is only sort of happy, and Bathsheba is irreparably scarred.