كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(29)
Chapter: The Ghazwa of Al-Khandaq or Al-Ahzab Battle
(29)
باب غَزْوَةُ الْخَنْدَقِ وَهْىَ الأَحْزَابُ
Sahih al-Bukhari 4100

Narrated Anas:

Al-Muhajirun (i.e. the Emigrants) and the Ansar were digging the trench around Medina and were carrying the earth on their backs while saying, "We are those who have given the pledge of allegiance to Muhammad for Islam as long as we live." The Prophet (ﷺ) said in reply to their saying, "O Allah! There is no goodness except the goodness of the Hereafter; so please grant Your Blessing to the Ansar and the Emigrants." The people used to bring a handful of barley, and a meal used to be prepared thereof by cooking it with a cooking material (i.e. oil, fat and butter having a change in color and smell) and it used to be presented to the people (i.e. workers) who were hungry, and it used to stick to their throats and had a nasty smell.

حَدَّثَنَا أَبُو مَعْمَرٍ، حَدَّثَنَا عَبْدُ الْوَارِثِ، عَنْ عَبْدِ الْعَزِيزِ، عَنْ أَنَسٍ ـ رضى الله عنه ـ قَالَ جَعَلَ الْمُهَاجِرُونَ وَالأَنْصَارُ يَحْفِرُونَ الْخَنْدَقَ حَوْلَ الْمَدِينَةِ، وَيَنْقُلُونَ التُّرَابَ عَلَى مُتُونِهِمْ وَهُمْ يَقُولُونَ نَحْنُ الَّذِينَ بَايَعُوا مُحَمَّدَا عَلَى الإِسْلاَمِ مَا بَقِينَا أَبَدَا قَالَ يَقُولُ النَّبِيُّ صلى الله عليه وسلم وَهْوَ يُجِيبُهُمُ ‏ "‏ اللَّهُمَّ إِنَّهُ لاَ خَيْرَ إِلاَّ خَيْرُ الآخِرَهْ، فَبَارِكْ فِي الأَنْصَارِ وَالْمُهَاجِرَهْ ‏"‏‏.‏ قَالَ يُؤْتَوْنَ بِمِلْءِ كَفَّى مِنَ الشَّعِيرِ فَيُصْنَعُ لَهُمْ بِإِهَالَةٍ سَنِخَةٍ تُوضَعُ بَيْنَ يَدَىِ الْقَوْمِ، وَالْقَوْمُ جِيَاعٌ، وَهْىَ بَشِعَةٌ فِي الْحَلْقِ وَلَهَا رِيحٌ مُنْتِنٌ‏.‏
Reference : Sahih al-Bukhari 4100
In-book reference : Book 64, Hadith 144
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 426
  (deprecated numbering scheme)