* Import git log into a spreadsheet
@ 2015-02-24 20:06 Phillip Susi
2015-02-24 20:08 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Phillip Susi @ 2015-02-24 20:06 UTC (permalink / raw)
To: git
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm trying to import a git log into a spreadsheet. I used a simple
- --pretty=format: switch to select the fields I wanted and separate
them with commas to generate a CSV file that can be imported. The
message body, however, is presenting a problem. The first problem is
that it contains newlines itself, which normally signal the start of a
new record. It turns out that even when quoting the field, MS Excel
still fails to import it properly ( good grief MS ), but openoffice
calc does. The second problem is that the body itself may contain quotes.
I can't figure out a good way to deal with these quotes. It seems
that replacing them with a pair of quotes should make the CSV valid,
but how can I replace only those quotes internal to the field without
replacing the quotes that actually bracket it? Is it possible to have
git log use a NULL terminator between records instead of a new line?
Or is there a better way of going about this?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
iQEcBAEBAgAGBQJU7NmpAAoJENRVrw2cjl5RWFEH/Re8o38zp+EqQxrOM7ZfypUy
Ebaqf8Sa3dIs57iJINnNNsy6kTyPGCxPphdI5zbN5DVuduYKldZSMIeQ1S3sysRq
SPH+E0KL1yxWEv8A0s5CKN/THvPHoUMpl0D7850LBrEmfQzyYNBE4NRBLHSPUL2w
pbAaDeQQwmTigwF6J1AYdz3FlZZznVGzR6ST/Tios64G33wePzPOulF8QyXjpQJq
R1QNRc9EmMz+FC1X/BwrPMX0e8YeTipjW+X/s6uMUXB6F9cln0VcNR5QOhDO1JDp
avbdSwl7nQWRX244cKPfX+eujBgC8RnyrLyz74vSsn1vO8BHtSrLMQ5+1Lbymjo=
=MTpF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Import git log into a spreadsheet
2015-02-24 20:06 Import git log into a spreadsheet Phillip Susi
@ 2015-02-24 20:08 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2015-02-24 20:08 UTC (permalink / raw)
To: Phillip Susi; +Cc: git
Phillip Susi <psusi@ubuntu•com> writes:
> I'm trying to import a git log into a spreadsheet. I used a simple
> --pretty=format: switch to select the fields I wanted and separate
> them with commas to generate a CSV file that can be imported. The
> message body, however, is presenting a problem. The first problem is
> that it contains newlines itself, which normally signal the start of a
> new record. It turns out that even when quoting the field, MS Excel
> still fails to import it properly ( good grief MS ), but openoffice
> calc does. The second problem is that the body itself may contain quotes.
>
> I can't figure out a good way to deal with these quotes. It seems
> that replacing them with a pair of quotes should make the CSV valid,
> but how can I replace only those quotes internal to the field without
> replacing the quotes that actually bracket it? Is it possible to have
> git log use a NULL terminator between records instead of a new line?
> Or is there a better way of going about this?
I think --pretty=format: (or --format) gives you a way to specify
the literal NUL. Also perhaps look at the -z option?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-24 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 20:06 Import git log into a spreadsheet Phillip Susi
2015-02-24 20:08 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox