-
- Downloads
json_writer: new routines to create JSON data
Add "struct json_writer" and a series of jw_ routines to compose JSON data into a string buffer. The resulting string may then be printed by commands wanting to support a JSON-like output format. The json_writer is limited to correctly formatting structured data for output. It does not attempt to build an object model of the JSON data. We say "JSON-like" because we do not enforce the Unicode (usually UTF-8) requirement on string fields. Internally, Git does not necessarily have Unicode/UTF-8 data for most fields, so it is currently unclear the best way to enforce that requirement. For example, on Linux pathnames can contain arbitrary 8-bit character data, so a command like "status" would not know how to encode the reported pathnames. We may want to revisit this (or double encode such strings) in the future. Helped-by:Eric Sunshine <sunshine@sunshineco.com> Helped-by:
René Scharfe <l.s.r@web.de> Helped-by:
Wink Saville <wink@saville.com> Helped-by:
Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by:
Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
Showing
- Makefile 2 additions, 0 deletionsMakefile
- json-writer.c 414 additions, 0 deletionsjson-writer.c
- json-writer.h 105 additions, 0 deletionsjson-writer.h
- t/helper/test-json-writer.c 565 additions, 0 deletionst/helper/test-json-writer.c
- t/helper/test-tool.c 1 addition, 0 deletionst/helper/test-tool.c
- t/helper/test-tool.h 1 addition, 0 deletionst/helper/test-tool.h
- t/t0019-json-writer.sh 331 additions, 0 deletionst/t0019-json-writer.sh
- t/t0019/parse_json.perl 52 additions, 0 deletionst/t0019/parse_json.perl
json-writer.c
0 → 100644
json-writer.h
0 → 100644
t/helper/test-json-writer.c
0 → 100644
t/t0019-json-writer.sh
0 → 100755
t/t0019/parse_json.perl
0 → 100644
Please register or sign in to comment