
132 Wis.2d 171 (1986)
389 N.W.2d 835
John J. SCHNEIDER, Plaintiff-Appellant,
v.
Janet B. SCHNEIDER, Defendant,
Allen E. SCHNEIDER and Carol J. Schneider, Defendants-Respondents.
No. 85-0447.
Court of Appeals of Wisconsin.
Submitted on briefs May 7, 1986.
Decided May 22, 1986.
*172 For the plaintiff-appellant the cause was submitted on the brief of Carl W. Ross and Kittelsen, Barry, Ross and Wellington of Monroe.
For the defendants-respondents the cause was submitted on the brief of Ronald W. Braun and Braun Law Offices of Brodhead.
Before Gartzke, P.J., Dykman and Eich, JJ.
EICH, J.
John J. Schneider appeals from a summary judgment dismissing his action to partition real estate. The dispositive issue is whether the action is barred by an agreement executed by Schneider, his brother Allen and their wives, each of whom had an ownership interest in the property. We conclude that the agreement precludes the action, and we therefore affirm.
We use the same procedure as the trial court in summary judgment cases; it is a well-documented procedure *173 that need not be repeated here.[1] The pleadings raise and join the issues, and the parties' affidavits indicate the existence of both a prima facie case for partition and a defense. Both parties moved for judgment on the undisputed facts.
In 1978, Schneider and his brother Allen acquired title to an undivided one-half interest in the family farm as tenants in common. Their wives were named with them in the deed.[2] All four then signed an agreement *174 restricting sale of the property. The agreement allows one brother to sell his half interest in the farm only with the other's consent and, failing that, only after first giving the other the right to purchase it. The "buy-out" price is established by the terms of the agreement. It sets $130,000 as the value of the farm for the year 1978 and directs the brothers to "stipulate the agreed value" annually thereafter. The stipulated figure forms the basis for calculating the value of the brothers' interests, should either wish to sell. In the event no such stipulation is reached in a given year, the agreement provides that the preceding year's valuation shall control. Upon the death of one brother, his interest is automatically transferred to the survivor. Each agreed to maintain life insurance in a designated amount for the purpose of compensating a deceased brother's estate for the survivor's acquisition of his interest. The agreement does not contain a termination date.
In 1983, John Schneider decided to sell his interest in the farm. In the five years the agreement had been in existence, however, the brothers had never finalized any annual stipulation as to the value of the property. When John could not agree with Allen on the 1983 value, he commenced this partition action. Allen and his wife and John's former wife (they are now divorced) were named as defendants. They raised the agreement as a defense, relying on sec. 842.02(1), Stats., which provides that anyone who owns an interest in land in common with others may sue to partition that interest "unless an action for partition is prohibited . . . by *175 agreement between the parties for a period not to exceed 30 years."
Allen and the wives argued, and the trial court agreed, that even though the agreement was silent as to its duration, it did not violate the thirty-year restriction because it had been in existence for only six years. While we disagree with the court's reasoning, we reach the same conclusion: the agreement is a defense to the partition action, and the complaint was properly dismissed.
John argues that because the agreement contains no termination date, it is, on its face, one that "exceeds 30 years" within the meaning of sec. 842.02(1), Stats., and thus does not defeat his action.
As a general rule, when a contract is of indefinite duration, we will imply a reasonable time for performance. Farley v. Salow, 67 Wis. 2d 393, 402, 227 N.W.2d 76, 82 (1975). Courts are reluctant to interpret contracts as providing for some perpetual or unlimited right unless the document itself clearly states that that is the intention of the parties. Capital Investments v. Whitehall Packing Co., 91 Wis. 2d 178, 193, 280 N.W.2d 254, 261 (1979), citing Consumers Ice Company v. United States, 475 F.2d 1161, 1166 (1973). Interpretations which avoid construing a contract to have an indefinite duration are preferable. Farley, at 402, 227 N.W.2d at 82.
The introductory paragraphs of the agreement state that its purpose is to retain ownership of the Schneider family farm in John and Allen "or the survivor of them." To this end, the brothers agreed to restrict "the right of either party to sell or otherwise dispose of his interest in the . . . real estate during his *176 lifetime, and to further provide for the purchase by the other of his interest . . . in the event of the death of one of the parties."
The contract is not indefinite. By its terms, it cannot be effective beyond the death of one brother. Admittedly, it is not known whether this "automatic" termination will occur within thirty years of the document's signing. But, the agreement is terminable by either party at any time. Either may liquidate his interest: (1) with the other's consent, or, failing that; (2) by selling to the other brother under the "buy-out" provisions. If the nonselling brother's consent is withheld, he is given a sixty-day option to purchase the seller's interest at a price to be calculated under the terms of the agreement. If he exercises the option, the sale is to him; if he fails to exercise the option, the selling brother is free to dispose of his interest as he wishes. A brother wishing to dispose of his undivided interest may thus do so at will under the agreement; the sale will be either to his brother under the buy-out clause, or to a third party upon the brother's consent or failure to exercise the contractual sixty-day option.
The right of a cotenant to partition and convey his or her interest in real property is favored in the law; it is often said to be a matter of right. 2 H. Tiffany, The Law of Real Property sec. 474, at 307-08 (3d ed. 1939). It is also recognized, however, that one may validly agree not to partition. Id. at 309. Because the law frowns on restrictions on the alienability of property, such agreements, to be valid, cannot extend for an unreasonable length of time. Id. at 202 (Supp. 1986); Restatement (Second) of Property: Donative Transfers secs. 4.1 comment a and 4.5 comment a (1981). Section *177 842.02(1), Stats., effects a similar compromise between these competing policies by establishing the "reasonable time" beyond which such agreements may not extend. Thus, an agreement which prohibits partition for a period of thirty years or more is invalid, while one with a lesser prohibition is enforceable and may bar the action.
In this case, the agreement does not prohibit either party from partitioning and selling his interest. It merely conditions that right on compliance with the consent and sixty-day option-to-purchase procedures. We conclude, therefore, that the agreement is valid under sec. 842.02(1), Stats., and the respondents' motion to dismiss was properly denied.[3]
By the Court.Judgment affirmed.
NOTES
[1]  See In re Cherokee Park Plat, 113 Wis. 2d 112, 115-16, 334 N.W.2d 580, 582-83 (Ct. App. 1983).
[2]  On the limited record before us, the nature and extent of the wives' interest in the property is unclear, as are their rights and obligations under the agreement.

The deed to the farm listed as grantees "John J. Schneider and Janet B. Schneider, as owners of an undivided one-half (½) interest as tenants in common, as well as tenants in common with Allen E. Schneider and Carol J. Schneider as owners of an undivided one-half interest as tenants in common."
The introductory paragraph of the agreement describes the wives, along with their husbands, as "owners of an undivided one-half interest" in the property "as tenants in common." The substantive terms of the document, however, state that only Schneider and his brother are "parties" to its terms. Throughout the agreement, the terms "party" or "parties" are referred to in the masculine gender. The confusion is compounded by the fact that the concluding paragraph of the agreement, which refers to the "parties . . . hav[ing] hereunto set their hands," is followed by the signatures of not only Schneider and his brother but the wives as well.
As if this weren't enough, the complaint alleges (and the answer admits) that when Schneider and his wife were divorced in 1983 their interests in the property were "changed from that as [sic] joint tenants to that of tenants in common."
While it would seem that the confusing language concerning the wives' interest in the land and their status under the agreement would figure in the arguments, the parties have ignored these questions, as do we.
[3]  Issues relating to establishment of the "buy-out" price under the terms of the agreement are not involved in this appeal. We hold only that the parties' agreement is valid as a bar to partition under sec. 842.02(1), Stats.
