FIXING A BREACH ON CHOL HA'MO'ED
6b (Mishnah): We may fix a breach on Chol ha'Mo'ed. In Shevi'is one may rebuild it normally.
7a - Question: How do we fix it?
Answer #1 (Rav Yosef): We use branches of date or laurel trees.
Answer #2 (Beraisa): He piles up rocks, but does not cement them.
(Rav Chisda): This refers to a wall of a garden, but one may build a Chatzer wall normally.
Version #1 - Support (Beraisa): If a wall is leaning over Reshus ha'Rabim (and might fall), one may destroy it and rebuild it normally, due to the danger.
Rejection: The Beraisa says that it is permitted (only) because of the danger!
Version #2 - Question (Beraisa): If a wall is leaning over Reshus ha'Rabim, one may destroy it and rebuild it normally, due to the danger.
Inference: If not for danger, it is forbidden!
Answer: When there is danger, one may destroy it and rebuild it. When there is no danger, one may build, but not destroy. (end of Version #2)
Question: When there is danger, it should suffice to destroy!
Answer: If that would be the law, people would not destroy it.
Support (for Rav Chisda - Rav Ashi - Mishnah): In Shevi'is one may rebuild it normally.
This cannot discuss a Chatzer, for this is no Chidush (nothing grows there)!
Rather, it discusses a garden. Even though it looks like he does so to guard his produce, it is permitted.
11a - Mishnah: One may build a Ma'akah for his roof or balcony Ma'aseh Hedyot (non-professionally), but not Ma'aseh Uman (professionally).
Rif and Rosh (1:8): Rav Yosef permits to fix the breach with date or laurel branches; a Beraisa permit piling up rocks without cement. This refers to a wall of a garden, but one may build a Chatzer wall normally. However, one may not destroy it, except for a wall that is leaning, due to the danger.
Nimukei Yosef (DH Gemara): We do not permit rebuilding a garden wall, for it is merely for privacy, therefore date branches or rocks without cement suffices. One may build a Chatzer wall normally, to protect from thieves. It is Devar ha'Eved, which R. Yosi permits normally.
Rambam (Hilchos Yom Tov 8:8): If a garden wall fell, one may build it Ma'aseh Hedyot, or fence it with reeds and similar things. Similarly, if one makes a Ma'akah around his roof he does it Ma'aseh Hedyot. If a Chatzer wall fell, one may build it normally. If it was leaning one may destroy it due to the danger and rebuild it normally.
Hagahos Maimoniyos (4): The Yerushalmi explains that Chachamim permit the end (rebuilding a leaning wall) for the sake of the beginning (otherwise, people will not destroy it). This is not on the Bavli's list (Beitzah 11b) of three cases in which the end was permitted for the sake of the beginning, for that refers only to Yom Tov.
Shulchan Aruch (540:1): One is liable for building any amount. If a garden wall was breached (Rema - or the Chatzer wall between him and his neighbor) he may build it Ma'aseh Hedyot. I.e. he piles up rocks without cement, or fences it with reeds and similar things.
Question (Taz 1): This implies that cementing is Ma'aseh Uman. But in Bava Metzi'a (101) we say that the tenant must do everything that is Ma'aseh Hedyot, such as making a ladder and plastering the roof!
Answer (Taz): To build something and apply plaster is Ma'aseh Uman; to merely apply plaster is not. Therefore, one may make a ladder and plaster the roof on Chol ha'Mo'ed for the sake of the Mo'ed.
Mishnah Berurah (3): To smooth the roof is Ma'aseh Hedyot, but to seal cracks or to make a nice ladder like Umanim is Ma'aseh Uman.
Mishnah Berurah (4): The Shulchan Aruch permits to fence a breach, but not to build an entire fence, even Ma'aseh Hedyot.
Kaf ha'Chayim (4): One hires a Nochri to build it Ma'aseh Hedyot, or a Yisrael who needs the money for food. If these are not possible, he may do it himself, for the Gemara did not specify.
Shulchan Aruch (ibid.): Similarly, if one makes a Ma'akah around his roof he does it Ma'aseh Hedyot.
Kaf ha'Chayim (7): The Ritva says that this is when people do not normally go on the roof. If they do, one may build it normally for it is obligatory. The other Poskim do not distinguish. If children are prone to knock it over, one may make it strong enough to prevent this.
Shulchan Aruch (ibid.): If a Chatzer wall bordering Reshus ha'Rabim fell, one may build it normally.
Beis Yosef (DH u'Mah she'Chosav and DH v'Chosvu): Rashi says that the lack of a garden wall entails only a small loss, but the lack of a Chatzer wall entails a big loss. Tosfos says that if one's neighbors are Yisraelim, a wall between Chatzeros may not be fixed normally. The Ramban says that since a Chatzer wall helps to guard one's house, Chachamim considered it like a need of Ochel Nefesh, and no Shinuy is needed.
Mishnah Berurah (5): If one's neighbors are Yisraelim but they are suspected of theft, one may fix the Chatzer wall normally.
Shulchan Aruch (ibid.): One may destroy a leaning wall due to the danger and rebuild it normally.
Beis Yosef (DH u'Mah she'Chosav v'Im): The Ra'avad says that the text of the Gemara did not say that the leaning wall hangs over Reshus ha'Rabim, for the same applies if it hangs over a Mavoy or Chatzer. The Mordechai says that it is dangerous only if it hangs over Reshus ha'Rabim or if thieves come ready to kill. If not, one may not destroy and rebuild it normally. The first opinion is primary.
Mishnah Berurah (6): One may destroy and rebuild it normally if it is so weak that there is a real concern lest it fall, especially if thieves might come ready to kill. However, one may not intentionally leave this for Chol ha'Mo'ed. When there is mortal danger, it is permitted b'Di'eved even if he intentionally left this for Chol ha'Mo'ed (Sha'ar ha'Tziyon 7).
Kaf ha'Chayim (13): We are more lenient for Safek danger than for Devar ha'Eved.
Rema: Even if it leans only over a Chatzer or Mavoy one may destroy it due to the danger and rebuild it. Likewise, for other things in which there is danger one may build and destroy normally.