From: Jeff Hostetler <jeffhost@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxx/ [v2] https://public-inbox.org/git/20180321192827.44330-1-git@xxxxxxxxxxxxxxxxx/ [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