path: root/t/
AgeCommit message (Collapse)Author
2018-07-16json_writer: new routines to create JSON dataJeff Hostetler
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 <> Helped-by: René Scharfe <> Helped-by: Wink Saville <> Helped-by: Ramsay Jones <> Signed-off-by: Jeff Hostetler <> Signed-off-by: Junio C Hamano <>