I am executing a command "git log" from php using shell_exec() function and getting the following response. How can i parse the response and get the commit hash and commit message ?
commit baedfa411c58584c4a98f3a632b7f3231500f92c Author: XYZ Date: Tue Apr 12 23:04:33 2016 +0530 commiting 3rd commit commit 251654c5f6f256fe6e23c2c85f1a70594aae00d4 Author: XYZ Date: Tue Apr 12 22:37:21 2016 +0530 commiting 2nd commit commit 3be3198a20d902e24e6b187cd0666ed0d5ee6c4d Author: XYZ Date: Tue Apr 12 22:34:31 2016 +0530 initial commit