Parashas Devarim
Devarim 2:5
Torah Temimah points to R’ Yudan — Yerushalmi Rosh Hashanah 1:1 (verified).
אל תתגרו בם — א"ר יודן ב"ר שלום: כתיב (מ"א י"א) כי ששה חדשים ישב שם יואב וכל ישראל עד הכרית כל זכר באדום; אמר לו הקב"ה: אני אמרתי לך אל תתגרו בם, ואתה בקשת להתגרות בם, חייך שאינם נמנים לך.
English: Do not contend with them — Rabbi Yudan son of Rabbi Shalom said: It is written that Joab and all Israel remained there six months until every male in Edom was cut off. The Holy One, blessed be He, said to him: “I told you, Do not contend with them,” yet you sought to contend with them; by your life, those months will not be counted for you.
Custom
Restraint toward Edom; violating the prohibition carries a consequence in the biblical chronology.