Patch Set 1:

Another solution could look like follows:

1. Replace all "\r\n" with "\n"
2. Replace remaining "\r" with "\n"
3. Now the "first line" of the commit message can be found by looking for the first "\n\n"