Production will only change things there if both tasks are carried out as part of the same service, charged as one. Otherwise, there will still be two outputs that nullify each other but both cause GDP to increase. But even then, if you charge someone for a service to dig and fill in holes, that there is no tangible product at the end does not mean there isn't an output that has a price, and that so increases GDP, just the same as, say, performing a dance does not leave a tangible product at the end, but the service still has a price and a value, and paying for it still increases GDP.
With respect to the opportunity cost, the point is not being able to quantity it, but that whether or not the task is productive, because it takes time, it has a cost.
> even then, if you charge someone for a service to dig and fill in holes, that there is no tangible product at the end does not mean there isn't an output that has a price, and that so increases GDP, just the same as, say, performing a dance does not leave a tangible product at the end, but the service still has a price and a value, and paying for it still increases GDP.
That blurs the line between the different calculation methods though, doesn't it? If nothing is produced then the production method of calculating wouldn't account for the transaction.
This method would also open the possibility for fraud. If the government wanted to boost GDP, for example, they could hire a bunch of people to dig a whole and fill it in all year. Would they? Probably not, they have easier ways to waste money and game GDP. But they could and that seems like a problem.
> because it takes time, it has a cost.
I don't know of any economic metrics that quantify the cost of time like this though. People like to point to unpaid labor as a huge blindspot for GDP precisely because of that - when your day is spent taking care of your home, children, or elderly parents the time is spent but GDP isn't impacted.