Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_writer: new routines to create JSON data #9

Commits on Jul 31, 2018

  1. 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 <[email protected]>
    Helped-by: René Scharfe <[email protected]>
    Helped-by: Wink Saville <[email protected]>
    Helped-by: Ramsay Jones <[email protected]>
    Signed-off-by: Jeff Hostetler <[email protected]>
    jeffhostetler committed Jul 31, 2018
    Configuration menu
    Copy the full SHA
    28b5a12 View commit details
    Browse the repository at this point in the history