It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said on the day of al-Hudaybiyah: "May Allah have mercy on those who shaved their heads." The Companions (may Allah be pleased with them) said: "O Messenger of Allah, and those who shortened their hair?" He (peace and blessings be upon him) said again: "May Allah have mercy on those who shaved their heads." They said: "O Messenger of Allah, and those who shortened their hair?" Then he (peace and blessings be upon him) said: "And those who shortened their hair as well." They said: "O Messenger of Allah, what is the matter with those who shaved their heads, that you have repeatedly expressed the prayer for mercy for them?" He (peace and blessings be upon him) said: "Indeed, they did not doubt."
These are the words of Zuhayr bin Harb, and the words of Ibn Mani' are close to them.
There is a supporting narration (shahid) for it in the two Sahihs from the hadith of Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) and Sayyiduna Abu Hurayrah (may Allah be pleased with him).