Sayyiduna Jabir (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) shaved his head at al-Hudaybiyah, and many of his Companions also shaved their heads. Then the Messenger of Allah (peace and blessings be upon him) said: "May Allah have mercy on those who shave their heads." A man said: "O Messenger of Allah, and on those who shorten their hair as well (pray for them)." He (peace and blessings be upon him) said again: "May Allah have mercy on those who shave their heads." Then the third time he said: "And on those who shorten their hair as well."
Hadith Referenceالمعجم الأوسط / باب الميم / 9198
Hadith Takhrij«أخرجه الطحاوي فى «شرح مشكل الآثار» برقم: 1367»