{"thread":{"id":"21140","subject":"git rev-list --pretty=raw strips empty lines","startedAt":"2009-10-06T12:33:37Z","lastAt":"2009-10-06T12:33:37Z","messageCount":1,"participants":["Rolf Bjarne Kvinge"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124315","messageId":"op.u1do6bq5k71drc@linux.lacasa","threadId":"21140","inReplyTo":null,"subject":"git rev-list --pretty=raw strips empty lines","fromName":"Rolf Bjarne Kvinge","fromEmail":"rkvinge@novell.com","sentAt":"2009-10-06T12:33:37Z","receivedAt":"2009-10-06T12:33:37Z","isPatch":false,"sender":{"key":"rkvinge@novell.com","avatar":null},"body":"Hi,\n\nIt seems like the --pretty=raw format strips off empty newlines from the beginning of log messages, while I'd expect the raw format to not do any transformations (just as the documentation says: \"The 'raw' format shows the entire commit exactly as stored in the commit object\").\n\nI've attached a test script that I can use to reproduce with current master (dbc1b1f71052c0)\n\nThe below changes works for me, not sure if I'm right about this though (my first time here ;-)\n\nRolf\n\ndiff --git a/pretty.c b/pretty.c\nindex f5983f8..1037700 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -868,7 +868,7 @@ void pp_remainder(enum cmit_fmt fmt,\n                         break;\n\n                 if (is_empty_line(line, &linelen)) {\n-                       if (first)\n+                       if (first && fmt != CMIT_FMT_RAW)\n                                 continue;\n                         if (fmt == CMIT_FMT_SHORT)\n                                 break;\n@@ -952,7 +952,8 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n         }\n\n         /* Skip excess blank lines at the beginning of body, if any... */\n-       msg = skip_empty_lines(msg);\n+       if (fmt != CMIT_FMT_RAW)\n+               msg = skip_empty_lines(msg);\n\n         /* These formats treat the title line specially. */\n         if (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)\n\n\n\n-- \nUsing Opera's revolutionary e-mail client: http://www.opera.com/mail/"}]}