git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: git@jeffhostetler.com
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, avarab@gmail.com,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH v3] routines to generate JSON data
Date: Fri, 23 Mar 2018 16:29:51 +0000	[thread overview]
Message-ID: <20180323162952.81443-1-git@jeffhostetler.com> (raw)

From: Jeff Hostetler <jeffhost@microsoft.com>

This is version 3 of my JSON data format routines.

This version addresses the variable name changes in [v2] and adds additional
test cases.  I also changed the BUG() calls to die() to help with testing.

The json-writer routines can be used generate structured data in a JSON-like
format.  I say "JSON-like" because we don't enforce the Unicode/UTF-8
requirement [3,4] on string values.  This was discussed on the mailing list
in the [v1] and [v2] threads, but to summarize here: Git doesn't know if
various fields, such as Unix pathnames and author names, are Unicode or just
8-bit character data, so Git would not know how to properly encode such
fields and the consumer of such output would not know these strings were
encoded (once or twice).  So, until we have a pressing need to generate
proper Unicode data, we avoid it for now.

The initial use for the json-writer routines is for generating telemetry data
for executed Git commands.  Later, we might want to use them in other commands
such as status.

[v1] https://public-inbox.org/git/20180316194057.77513-1-git@jeffhostetler.com/
[v2] https://public-inbox.org/git/20180321192827.44330-1-git@jeffhostetler.com/
[3]  http://www.ietf.org/rfc/rfc7159.txt
[4]  http://json.org/


Jeff Hostetler (1):
  json_writer: new routines to create data in JSON format

 Makefile                    |   2 +
 json-writer.c               | 321 +++++++++++++++++++++++++++++++++
 json-writer.h               |  86 +++++++++
 t/helper/test-json-writer.c | 420 ++++++++++++++++++++++++++++++++++++++++++++
 t/t0019-json-writer.sh      | 213 ++++++++++++++++++++++
 5 files changed, 1042 insertions(+)
 create mode 100644 json-writer.c
 create mode 100644 json-writer.h
 create mode 100644 t/helper/test-json-writer.c
 create mode 100755 t/t0019-json-writer.sh

-- 
2.9.3


             reply	other threads:[~2018-03-23 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 16:29 git [this message]
2018-03-23 16:29 ` [PATCH v3] json_writer: new routines to create data in JSON format git
2018-03-23 17:18   ` Jonathan Nieder
2018-03-23 19:33     ` Jeff Hostetler
2018-03-23 16:41 ` [PATCH v3] routines to generate JSON data Jonathan Nieder
2018-03-23 18:14 ` Ramsay Jones
2018-03-23 19:36   ` Jeff Hostetler

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20180323162952.81443-1-git@jeffhostetler.com \
    --to=git@jeffhostetler.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).