{"thread":{"id":"38642","subject":"Import git log into a spreadsheet","startedAt":"2015-02-24T20:06:01Z","lastAt":"2015-02-24T20:08:08Z","messageCount":2,"participants":["Phillip Susi","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256587","messageId":"54ECD9A9.4090507@ubuntu.com","threadId":"38642","inReplyTo":null,"subject":"Import git log into a spreadsheet","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2015-02-24T20:06:01Z","receivedAt":"2015-02-24T20:06:01Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nI'm trying to import a git log into a spreadsheet.  I used a simple\n- --pretty=format: switch to select the fields I wanted and separate\nthem with commas to generate a CSV file that can be imported.  The\nmessage body, however, is presenting a problem.  The first problem is\nthat it contains newlines itself, which normally signal the start of a\nnew record.  It turns out that even when quoting the field, MS Excel\nstill fails to import it properly ( good grief MS ), but openoffice\ncalc does.  The second problem is that the body itself may contain quotes.\n\nI can't figure out a good way to deal with these quotes.  It seems\nthat replacing them with a pair of quotes should make the CSV valid,\nbut how can I replace only those quotes internal to the field without\nreplacing the quotes that actually bracket it?  Is it possible to have\ngit log use a NULL terminator between records instead of a new line?\nOr is there a better way of going about this?\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\n\niQEcBAEBAgAGBQJU7NmpAAoJENRVrw2cjl5RWFEH/Re8o38zp+EqQxrOM7ZfypUy\nEbaqf8Sa3dIs57iJINnNNsy6kTyPGCxPphdI5zbN5DVuduYKldZSMIeQ1S3sysRq\nSPH+E0KL1yxWEv8A0s5CKN/THvPHoUMpl0D7850LBrEmfQzyYNBE4NRBLHSPUL2w\npbAaDeQQwmTigwF6J1AYdz3FlZZznVGzR6ST/Tios64G33wePzPOulF8QyXjpQJq\nR1QNRc9EmMz+FC1X/BwrPMX0e8YeTipjW+X/s6uMUXB6F9cln0VcNR5QOhDO1JDp\navbdSwl7nQWRX244cKPfX+eujBgC8RnyrLyz74vSsn1vO8BHtSrLMQ5+1Lbymjo=\n=MTpF\n-----END PGP SIGNATURE-----\n"},{"id":"256589","messageId":"xmqq7fv7qdhz.fsf@gitster.dls.corp.google.com","threadId":"38642","inReplyTo":"54ECD9A9.4090507@ubuntu.com","subject":"Re: Import git log into a spreadsheet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-02-24T20:08:08Z","receivedAt":"2015-02-24T20:08:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Susi <psusi@ubuntu.com> writes:\n\n> I'm trying to import a git log into a spreadsheet.  I used a simple\n> --pretty=format: switch to select the fields I wanted and separate\n> them with commas to generate a CSV file that can be imported.  The\n> message body, however, is presenting a problem.  The first problem is\n> that it contains newlines itself, which normally signal the start of a\n> new record.  It turns out that even when quoting the field, MS Excel\n> still fails to import it properly ( good grief MS ), but openoffice\n> calc does.  The second problem is that the body itself may contain quotes.\n>\n> I can't figure out a good way to deal with these quotes.  It seems\n> that replacing them with a pair of quotes should make the CSV valid,\n> but how can I replace only those quotes internal to the field without\n> replacing the quotes that actually bracket it?  Is it possible to have\n> git log use a NULL terminator between records instead of a new line?\n> Or is there a better way of going about this?\n\nI think --pretty=format: (or --format) gives you a way to specify\nthe literal NUL.  Also perhaps look at the -z option?\n"}]}