git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Import git log into a spreadsheet

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2015, 20:08 UTC
Message-ID
<xmqq7fv7qdhz.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54ECD9A9.4090507@ubuntu.com>
Phillip Susi <psusi@ubuntu.com> writes:
Show 15 quoted lines
> 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?

Previous: Phillip Susi
Message 2 of 2 in “Import git log into a spreadsheet”
  1. Phillip SusiFeb 24, 2015
  2. Junio C HamanoFeb 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.