Mishkat al-Masabih 3377
Al-Bara’ b. ‘Azib said the Prophet made peace on the occasion of al-Hudaibiya on three conditions:
that if any of the polytheists came to him he should send them back to them; that if any of the Muslims went to them they should not send them back; and that he should be allowed to enter [Mecca] the following year and stay in it for three days. When he entered it and the period had passed he went out, and Hamza’s daughter followed him calling, “Uncle, uncle.” ‘Ali took her and held her by the hand, and ‘Ali, Zaid and Ja'far disputed about her. ‘Ali said, “I have taken her, and she is the daughter of my paternal uncle.” Ja'far said, “She is the daughter of my paternal uncle and her maternal aunt is my wife.” Zaid said, “She is my brother’s daughter.” The Prophet then gave decision about her in favour of her maternal aunt, saying, “The maternal aunt is in the position of the mother.” To ‘Ali he said, “You pertain to me and I pertain to you;” to Ja'far, “You resemble my form and nature;” and to Zaid, “You are our brother and client.”
 
(Bukhari and Muslim.)
وَعَنِ الْبَرَاءِ بْنِ عَازِبٍ قَالَ: صَالَحَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ يَوْمَ الْحُدَيْبِيَةِ عَلَى ثَلَاثَةِ أَشْيَاءَ: عَلَى أَنَّ مَنْ أَتَاهُ مِنَ الْمُشْرِكِينَ رَدَّهُ إِلَيْهِمْ وَمَنْ أَتَاهُمْ مِنَ الْمُسْلِمِينَ لَمْ يَرُدُّوهُ وَعَلَى أَنْ يَدْخُلَهَا مِنْ قَابِلٍ وَيُقِيمَ بِهَا ثَلَاثَةَ أَيَّامٍ فَلَمَّا دَخَلَهَا وَمَضَى الْأَجَلُ خَرَجَ فَتَبِعَتْهُ ابْنَةُ حَمْزَةَ تُنَادِي: يَا عَمِّ يَا عَمِّ فَتَنَاوَلَهَا عَلِيٌّ فَأَخَذَ بِيَدِهَا فَاخْتَصَمَ فِيهَا عَلِيٌّ وَزَيْدٌ وَجَعْفَرٌ قَالَ عَلِيٌّ: أَنَا أَخَذْتُهَا وَهِيَ بِنْتُ عَمِّي. وَقَالَ جَعْفَرٌ: بِنْتُ عَمِّي وَخَالَتُهَا تَحْتِي وَقَالَ زَيْدٌ: بِنْتُ أَخِي فَقَضَى بِهَا النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لِخَالَتِهَا وَقَالَ: «الْخَالَةُ بِمَنْزِلَةِ الْأُمِّ» . وَقَالَ لَعَلِيٍّ: «أَنْتَ مِنِّي وَأَنَا مِنْكَ» وَقَالَ لِجَعْفَرٍ: «أَشْبَهْتَ خَلْقِي وَخُلُقِي» . وَقَالَ لزيد: «أَنْت أخونا ومولانا»