Subject: Re: [RFC/PATCH 2/3] add a library of code for producing structured output

From: Jakub Narebski <[email-masked]>
Date: Sun, 11 Apr 2010 08:46:46 -0700 (PDT)

Julian Phillips <[email-masked]> writes:

> Add a library that allows commands to produce structured output in any
> of a range of formats using a single API.
> 
> The API includes an OPT_OUTPUT and handle_output_arg so that the
> option handling for different commands will be as similar as possible.
> 
> At the moment JSON and XML output options are available - though the
> XML output is _very_ rudimentary.
> 
> Signed-off-by: Julian Phillips <[email-masked]>
> ---
>  Makefile      |    3 +
>  output-json.c |  128 ++++++++++++++++++++++++++++++++++
>  output-xml.c  |   68 ++++++++++++++++++
>  output.c      |  212 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  output.h      |   71 +++++++++++++++++++
>  5 files changed, 482 insertions(+), 0 deletions(-)
>  create mode 100644 output-json.c
>  create mode 100644 output-xml.c
>  create mode 100644 output.c
>  create mode 100644 output.h

How about some technical documentation, in the form of
Documentation/technical/api-structured-output.txt (or something like
that), describing how this API should be used.

How about some tests?  Note that you need to take care of commits that
are encoded in encoding other than utf-8 (but with 'encoding' header,
so you know what encoding it is), and of filenames that are invalid
UTF-8 (and their encoding is unknown in general: they are raw binary
data).  You need to take care of non-ASCII characters, and of special
characters (like '"', SPC, TAB, LF, '\') in commits and in filenames.

-- 
Jakub Narebski
Poland
ShadeHawk on #git