public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Phillip Susi <psusi@ubuntu•com>
Cc: git@vger•kernel.org
Subject: Re: Import git log into a spreadsheet
Date: Tue, 24 Feb 2015 12:08:08 -0800	[thread overview]
Message-ID: <xmqq7fv7qdhz.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54ECD9A9.4090507@ubuntu.com> (Phillip Susi's message of "Tue, 24 Feb 2015 15:06:01 -0500")

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?

      reply	other threads:[~2015-02-24 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 20:06 Import git log into a spreadsheet Phillip Susi
2015-02-24 20:08 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7fv7qdhz.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=psusi@ubuntu$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox