Homemade pesto. Source: Wikimedia Commons
"Pesto is thought to have two predecessors in ancient times, going back as far as the Roman age. The ancient Romans used to eat a similar paste called moretum, which was made by crushing garlic, salt, cheese, herbs, olive oil, and vinegar (and sometimes pine nuts) together. The use of this paste in the Roman cuisine is mentioned in the Appendix Vergiliana, an ancient collection of poems in which the author details the preparation of moretum. During the Middle Ages, a popular sauce in the Genoan cuisine was agliata, which was basically a mash of garlic and walnuts, as garlic was a staple in the nutrition of Ligurians, especially for the seafarers."
The Roman era cheese spread contains the ingredients of modern pesto, if, as Wikipedia states, pine nuts were added (though pine nuts did not appear in Symilius's moretum). On the other hand, there have been modern takes on pesto that forsake garlic, olive oil and vinegar altogether in favor of Asian and African ingredients with similar properties. The Food Network has a page of 50 different "pesto" recipes here. Various recipes in this list feature ingredients such as grapeseed oil, coconut oil, sesame oil, peanuts, pistachios, almonds, lime juice and fish sauce.
What this information shows us as that food-related practices are very conservative, in that they change, if at all, very slowly over time. Very old recipes may come in and out of fashion, but do not die out, as the story of gingerbread demonstrates. What seems to matter more than the exact ingredients of a dish is the function the food plays in people's eating habits. Whether you eat "pesto" or "moretum," you probably eat it smeared on bread, the way Symilius, the Roman farmer whose use of moretum was preserved in Virgil's poem, did. That's as much continuity as a food historian can typically promise.