what if there is no level of punishment that will deter the person
Taking arguendo the question you highlight:
By cruel empirical evidence, we know that a six-month jail sentence was sufficiently effective enough that it made Swartz end his life, to say nothing of merely stopping his attempts to liberate the JSTOR archives.
Given that, a few days in jail would have likely taken the shine off of his activism and made him realize he wasn't cut out for this kind of thing.
Of course this can't be mathematically proven, but nothing involving humans is. It's one reason for increasing sentences for repeat offenders: the justice system is experimentally trying to find out how much punishment you need to get the message to stop doing that.
a six-month jail sentence was sufficiently effective enough that it made Swartz end his life, to say nothing of merely stopping his attempts to liberate the JSTOR archives
Well, if we're taking this point of view, what stopped his attempts to liberate the JSTOR archives was the private settlement he reached with JSTOR, before he knew he was facing any jail time at all. The jail time was completely superfluous in that respect.
That said, Kerr's article makes a comment in a somewhat similar vein to yours:
"[T]his is one of the puzzles about Swartz. On one hand, he was deeply committed to civil disobedience and to the moral imperative of breaking unjust laws. On the other hand, he seems to have had his soul crushed by the prospect that he would spend time in jail. This is an unusual combination."
However, I still think the "deterrence" theory of punishment doesn't quite fit a case of civil disobedience. Increased punishment for repeat offenders assumes that the offenders have no reason other than narrow self-interest for violating the law--in other words, they commit crimes because they think it benefits them, so making it not benefit them should, at some point, get them to stop committing crimes. But someone who breaks the law for the greater good is not doing it for their own benefit to begin with.
Taking arguendo the question you highlight:
By cruel empirical evidence, we know that a six-month jail sentence was sufficiently effective enough that it made Swartz end his life, to say nothing of merely stopping his attempts to liberate the JSTOR archives.
Given that, a few days in jail would have likely taken the shine off of his activism and made him realize he wasn't cut out for this kind of thing.
Of course this can't be mathematically proven, but nothing involving humans is. It's one reason for increasing sentences for repeat offenders: the justice system is experimentally trying to find out how much punishment you need to get the message to stop doing that.