J. S. Bach fans already know this (probably) but one of the fascinating things about the Baroque era was how isometric rhythm changed the assymetrical phrase into the symmetrical phrase; the odd rhythm into an even; and the modal chant into a major or minor melody.
What's interesting about the fugue from the C major violin sonata is it's "church" fugue. The subject for the fugue has, as Bach scholars can tell ya for free online, derived from a 15th century Lutheran hymn for Pentecost.
What's also interesting about that melodic contour is that as, er, Pentecostal tunes go there's a case to be made that the Lutheran hymn has a melodic profile that is an outworking of the old 9th century Gregorian chant Veni Creator Spiritus.
There are differences, of course, but that tune that starts by oscillating around what today would sound like the fifth of a chord is still there (not that there were major or minor keys in the 9th or 15th century, tonality as we've come to think of it would emerge for centuries).