Written between 300-500 AD, quoting earlier sources:
4. And it repented the Lord that He had made man on the earth (vi, 6). R. Judah said: [God declared:] It was a regrettable error on My part to have created him out of earthly elements, for had I created him out of heavenly elements, he would not have rebelled against Me/ R. Nehemiah interpreted it:
I am comforted (menuham) that I created him below, for had I created him above, he would have incited the celestial creatures to revolt, just as he has incited the terrestrial beings to revolt. R. Aibu interpreted: It was a regrettable error on My part to have created an evil urge (yezer ha-ra) within him, for had I not created an evil urge within him, he would not have rebelled against Me. 1 R. Levi interpreted: I am comforted that I made him from the earth.
And it grieved Him at His heart. R. Berekiah said: If a king has a palace built by an architect and when he sees it, it displeases him, against whom is he to complain? Surely against the architect! Similarly, It grieved Him at His heart.
A certain Gentile asked R. Joshua b. Karhah [mid second century]: ‘Do you not maintain that the Holy One, blessed be He, foresees the future?’ ‘Yes/ replied he. ‘But it is written, And it grieved Him at His heart?’ 4 ‘Has a son ever been born to you?’ inquired he. ‘Yes,’ was the answer. ‘And what did you do?’ — ‘I rejoiced and made all others rejoice/ he answered. ‘Yet did you not know that he would eventually die?’ ‘Gladness at the time of gladness, and mourning at the time of mourning,’ replied he. ‘Even so was it with the Holy One, blessed be He/ was his rejoinder, ‘for R, Joshua b. Levi said: Seven days the Holy One, blessed be He, mourned for His world before bringing the Flood, for it is said here, And it grieved Him, while elsewhere it says, The king grieveth for his son’ (n Sam. xix, 3). 5
1 Th.: possibly JR. Aibu translates the end of the verse thus: and it grieved Him for his (man’s) heart, i.e. the desire to evil which the heart harbours.
For it repenteth Me, etc. R. Abba b. Kahana observed: For it repenteth Me that I have made them and Noah — surely not! 6 Even Noah, however, was left not because he deserved it, but because
he found grace: hence, But Noah found grace in the eyes of the Lord. 7