Retaliation and the sword
Non-retaliation and love of enemies beside 'let him who has no sword buy one' and the talion law of Exodus 21 and Leviticus 24 read as a judicial limit — personal ethics, pacifism and just-war readings.
Matthew 5:38-44
38“You have heard that it was said, ‘An eye for an eye, and a tooth for a tooth.’
39But I tell you, don’t resist him who is evil; but whoever strikes you on your right cheek, turn to him the other also.
40If anyone sues you to take away your coat, let him have your cloak also.
41Whoever compels you to go one mile, go with him two.
42Give to him who asks you, and don’t turn away him who desires to borrow from you.
43“You have heard that it was said, ‘You shall love your neighbor and hate your enemy.’
44But I tell you, love your enemies, bless those who curse you, do good to those who hate you, and pray for those who mistreat you and persecute you,
Luke 22:35-38
35He said to them, “When I sent you out without purse, wallet, and sandals, did you lack anything?” They said, “Nothing.”
36Then he said to them, “But now, whoever has a purse, let him take it, and likewise a wallet. Whoever has none, let him sell his cloak, and buy a sword.
37For I tell you that this which is written must still be fulfilled in me: ‘He was counted with transgressors.’ For that which concerns me has an end.”
38They said, “Lord, behold, here are two swords.” He said to them, “That is enough.”
What each tradition says
Rabbinic / Midrashic
Rashi comments on Exodus 21:24 that “eye for eye” does not mean cutting off the offender’s limb. Instead, the offender pays the injured person the value of the eye—how much his value would be reduced if sold as a slave. Rashi says all other such cases are treated the same way, as the Rabbis explained in Bava Kamma 84a.
Rashi (Rabbi Shlomo Yitzhaki, 1040-1105), Pentateuch with Rashi's Commentary (trans. M. Rosenbaum and A. M. Silbermann, 1929-1934; Sefaria text) — comment on Exodus 21:24 ('eye for eye'), citing Bava Kamma 84a
Patristic
Augustine reads Jesus as teaching that not returning evil for evil is not enough; one must also be prepared to receive even more. He notes Christ did not phrase the command only as “do not return evil for evil,” though that is a great precept, but said “do not resist evil.”
Augustine of Hippo (354-430), Our Lord's Sermon on the Mount (trans. William Findlay), in Nicene and Post-Nicene Fathers, ser. 1, vol. 6 (ed. Philip Schaff; Buffalo: Christian Literature Publishing Co., 1888) — Book I, ch. 19, §57 (on Matt. 5:38-39)
Catholic
Aquinas says such precepts should always be held in readiness of mind: we should be ready to obey them and, if necessary, to refrain from resistance or self-defense. Yet sometimes a man must act otherwise for the common good or the good of those with whom he fights.
Thomas Aquinas (c. 1225-1274), Summa Theologica, Part II-II, q. 40 (trans. Fathers of the English Dominican Province, 1920; New Advent text) — II-II, q. 40, a. 1, reply to objection 2 ('Whether it is lawful for Christians to wage war')
Orthodox
Cyril says Christ’s words about purse and scrip seemed addressed to the apostles, but really applied to every Jew. Christ did not command the holy apostles to get a purse and scrip. Rather, whoever had property in Jewish territories should gather what he had and flee, to save himself if possible.
Cyril of Alexandria (c. 376-444), A Commentary upon the Gospel according to S. Luke (trans. R. Payne Smith; Oxford: Oxford University Press, 1859), Sermon CXLV — on Luke 22:35-38
Reformed / Protestant
Calvin reads the command to buy a sword metaphorically. Jesus threatens that they will soon meet with great troubles and fierce attacks. Like a general leading soldiers into battle, he calls them to arms and to set aside every other care, thinking only of fighting, not even of procuring food.
John Calvin (1509-1564), Commentary on a Harmony of the Evangelists, Matthew, Mark, and Luke, vol. 3 (trans. William Pringle; Edinburgh: Calvin Translation Society, 1846; CCEL text) — Commentary on Luke 22:36
Evangelical
Barnes says the judicial rule is not unjust. Christ finds no fault with it as applied by magistrates and does not repeal it. But the Jews extended it to private conduct, using it to take revenge by inflicting the same injury received; Christ remonstrates against that.
Albert Barnes (1798-1870), Notes on the New Testament, Explanatory and Practical, enlarged type ed., ed. Robert Frew (Grand Rapids: Baker Book House; CCEL text) — note on Matthew 5:38-41