Providing a sensible answer is dependent on arriving at a sensible interpretation of the question. I'll assume that it is aimed at understanding to what degree farming or non-farming lifestyles have had an influence on the selection of genes that you carry. I assume that "farming lifestyle" includes people who don't actually farm, but obtain food from farmers, one way or another.
On that basis, and assuming you are a typical inhabitant of a society that hasn't recently engaged in much hunting/gathering (maybe some fishing, but not dominant), I would say that about 1/30 of your ancestors were of a farming lifestyle. That is, if you trace back what the selective influences were on your ancestors, about 1/30 of it was selection for reproduction in a farming community. I get the 1/30 by dividing 300,000 years of homo sapiens into 10,000 years of agriculture.
I don't think the population sizes at different times, and collapse of the pedigree (some of your ancestors being the same people), make any difference. It might make a difference if the number of children per person varied, since each child is a new object for selection, but I think this may be rather constant until very recent times. And of course, the number of children who survive to reproduce themselves is close to two at all times. (The population has grown over time, but at nowhere near the rate it would if, say, three children per couple survived to reproduce themselves.)
Now, depending on how quick evolution can act, the fact that the 1/30 of the selection influence is the most recent 1/30 could be crucial.
Okay, assuming this means "how many Homo Sapiens ancestors did you have that spent substantial amounts of their working life farming", I think every human being alive has around 25x more non-farmers than farmers as ancestors. I think the ratio is so large that the answers doesn't change even if you ask "how many ancestors lived in agricultural societies" instead of "how many ancestors were farmers" and regardless of where your ancestors were - even comparing people whose ancestors were all in a place that invented agriculture early vs someone whose ancestors didn't start farming until after the industrial revolution.
The only thing that matters, to the extent that it swamps every other variable, is how long humans have been farming. Per Wikipedia, Agriculture developed in multiple places around the world after the last Ice Age, ~10,000 years ago. Homo Sapiens is about 30 times older evolving ~300,000 ago. The number of years your ancestors could have possibly been farmers is a rounding error compared to that.
I don't think changing generation length matters much - it's probably between 15 and 30 years for basically all your ancestors up to the modern day, nowhere near the ratio it would need to make a difference to the answer. Pedigree collapse (some of your ancestors show up in multiple places in your family tree, moreso the farther back you go) matters, but again it can't possible swamp the ~30x difference in number of generations. And, at the very least, you're guaranteed to have at least 2 ancestors per generation.
This is a great question, thanks for posting it!
Why do you think pedigree collapse wouldn't swamp the difference? I think that part's underargued