This song and melody are known in multiple variations and used in multiple settings. The flowing melody is popular with classical singers as well as folk and hymn singers. The roots of this song seem to go back to Scotland where is is known as "O Waly, Waly".
A version of it that begins "Waly, Waly, Gin Love Be Bonny" is in Ramsay's Tea Table Miscellany of 1724. Cecil Sharp collected at least five versions of this song and published it in Folk Songs From Somerset (1906) and also in One Hundred English Folksongs (1916).
The verses about failing love are related to the family of songs that include "On Top of Old Smokey", "The Wagoner's Lad" and "The Butcher's Boy".
It has been recorded in numerous styles by many singers under both titles: Pete Seeger, Joan Baez, Enya, Steeleye Span and The Kingston Trio ("The River is Wide") and many others.