It is narrated from Nafi' (may Allah have mercy on him) that Sayyiduna Umar bin al-Khattab (may Allah be pleased with him) used to order that the rows be levelled (that is, he would assign some men the duty of straightening the rows), and when those men came and informed him that the rows had become straight, then he would say the takbir.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2292