Vâhidî
From the commentators: when al-Abbas was taken captive on the day of Badr, the Muslims came to him and rebuked him for his disbelief in God and his severing of kinship ties, Ali spoke harshly to him, al-Abbas said, "why do you mention our faults but not our good deeds?", Ali said, "do you have good deeds?", he said, "yes, we maintain the Sacred Mosque, cover the Ka'ba, give water to the pilgrims, free the one in distress," whereupon God, in response to al-Abbas, revealed the verse, "it is not fitting for the polytheists to maintain God's mosques."
قوله تعالى: {ما كان للمشركين أن يعمروا مساجد الله} {17} . قال المفسرون لما أسر العباس يوم بدر أقبل عليه المسلمون فعيروه بكفره بالله وقطيعة الرحم، وأغلظ علي له القول، فقال العباس: ما لكم تذكرون مساوينا ولا تذكرون، محاسننا، فقال له علي: ألكم محاسن؟ قال: نعم، إنا لنعمر المسجد الحرام، ونحجب الكعبة، ونسقي الحاج، ونفك العاني؛ فأنزل الله - عز وجل - ردا على العباس: {ما كان للمشركين أن يعمروا} الآية. (1) -
Süyûtî
From Ibn Abi Hatim, via Ali ibn Abi Talha, related from Ibn Abbas: when al-Abbas was taken captive on the day of Badr, he said, "even if you preceded us in Islam, emigration, and struggle, we used to maintain the Sacred Mosque, give water to the pilgrims, free the one in distress," whereupon the verse was revealed, "do you equate giving water to pilgrims (with Islam and struggle)?" From Muslim, Ibn Hibban, and Abu Dawud, related from al-Nu'man ibn Bashir: I was near the Prophet's pulpit among some companions, one said, "after Islam I care for no deed except giving water to the pilgrims," one said, "maintaining the Sacred Mosque is better," one said, "no, struggle in God's cause is better than all you have said"; Umar rebuked them and said, "do not raise your voices near the Prophet's pulpit" — it was a Friday — "but after the Friday prayer I will go to the Prophet and ask him about your dispute," whereupon the verse was revealed, "giving water to pilgrims and maintaining the Sacred Mosque... God does not guide the wrongdoing people" down to this verse. From Ibn Sirin: Ali came to Mecca and said to al-Abbas, "uncle, will you not emigrate, join the Prophet?", he said, "I maintain the Mosque, cover the House," whereupon this verse was revealed; some named individuals were also told, "will you not emigrate, join the Prophet?", they said, "we will stay with our brothers, our tribes, and our dwellings," whereupon the verse "if your fathers..." was revealed in full. From Muhammad ibn Ka'b al-Qurazi: Talha ibn Shayba, al-Abbas, and Ali ibn Abi Talib entered a contest of boasting, Talha said, "I am the keeper of the House, I have its key," al-Abbas said, "I am the keeper of the water-supply and its overseer," Ali said, "I prayed toward the qibla before the people, I am among the fighters," whereupon the verse "giving water to pilgrims..." was revealed in full.
قوله تعالى @QB@ ما كان للمشركين @QE@ الآيات أخرج ابن أبي حاتم من طريق علي بن أبي طلحة عن ابن عباس قال قال العباس حين أسر يوم بدر إن كنتم سبقتمونا بالإسلام وإلهجرة والجهاد لقد كنا نعمر المسجد الحرام ونسقي الحاج ونفك العاني فأنزل الله @QB@ أجعلتم سقاية الحاج @QE@ الآية وأخرج مسلم وابن حبان وأبو داود عن النعمان بن بشير قال كنت عند منبر رسول الله صلى الله عليه وسلم في نفر من أصحابه فقال رجل منهم ما أبالي أن لا أعمل لله عملا بعد الإسلام إلا أن أسقي الحاج وقال آخر بل عمارة المسجد الحرام وقال آخر بل الجهاد في سبيل الله خير مما قلتم فزجرهم عمر وقال لا ترفعوا أصواتكم عند منبر رسول الله صلى الله عليه وسلم وذلك يوم الجمعة ولكن إذا صليت الجمعة دخلت على رسول الله صلى الله عليه وسلم فاستفتيته فيما اختلفتم فيه فأنزل الله @QB@ أجعلتم سقاية الحاج @QE@ إلى قوله @QB@ لا يهدي القوم الظالمين @QE@ وأخرج الفريابي عن ابن سيرين قال قدم علي بن أبي طالب مكة فقال للعباس أي عم ألا تهاجر ألا تلحق برسول الله صلى الله عليه وسلم فقال أعمر المسجد وأحجب البيت فأنزل الله @QB@ أجعلتم سقاية الحاج @QE@ الآية وقال لقوم سماهم ألا تهاجروا ألا تلحقوا برسول الله صلى الله عليه وسلم فقالوا نقيم مع إخواننا وعشائرنا ومساكننا فأنزل الله @QB@ قل إن كان آباؤكم @QE@ الآية كلها وأخرج عبد الرزاق عن الشعبي نحوه وأخرج ابن جرير عن محمد بن كعب القرظي قال إفتخر طلحة بن شيبة والعباس وعلي بن أبي طالب فقال طلحة أنا صاحب البيت معي مفتاحه وقال العباس أنا صاحب السقاية والقائم عليها فقال علي لقد صليت إلى القبلة قبل الناس وأنا صاحب الجهاد فأنزل الله @QB@ أجعلتم سقاية الحاج @QE@ الآية كلها