git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH v2 0/4] A new library for plumbing output

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 14, 2010, 20:57 UTC
Message-ID
<80f140cdddc016f9b4608d79f1bc3722@212.159.54.234>
In-Reply-To
<201004142110.36453.jnareb@gmail.com>

On Wed, 14 Apr 2010 21:10:35 +0200, Jakub Narebski <jnareb@gmail.com> wrote:

Show 7 quoted lines
> On Mon, 12 April 2010, Sverre Rabbelier wrote:
>> 
>> On Mon, Apr 12, 2010 at 01:21, Julian Phillips
>> <julian@quantumfyre.co.uk> wrote:
>> > Probably the biggest change from v1 is an expanded aim.  Now the
>> > output library
>> > is aimed at controlling _all_ plubming output.  This series includes
a
Show 12 quoted lines
>> > patch for
>> > ls-tree that has all it's output going through the library, and a
>> > patch for
>> > status that has all the --porcelain output going through the library.
>> 
>> I like where this is going, a lot, especially since we don't have to
>> convert everything in one go, but we can do it as desired, similar to
>> optparsification. I still think more commands than just these two
>> should be converted to validate the design though, perhaps something
>> like 'git blame', or 'git for-each-ref'?
> 
> I don't think it is needed for either command.

I think that the ability to say that all plumbing output is available in a variety of standard outputs is potentially useful. In particular the ability to be able to parse the output of all plumbing commands directly into whatever native language the high-level tool is in using an already existing standard parser makes life easier for those writing the tool.

> 'git blame' has --porcelain and --incremental output, which is
line-based
> and pretty much self-describing (with "header-name value" syntax for
most
> of it), and well documented.  JSON output would only add unnecessary
> chatter and different quoting rules.

That depends really. If you are writing something to parse the output, and you already have a JSON parser available then it's the current output that has different quoting rules. ;)

Anyway, I have already converted blame to use the library for both --porcelain and --incremental output, so it'll be in the next version of the patch series. So you can try before you buy ...

> 'git for-each-ref' has both --format=<format> to allow to get data what
> one needs, and in the format one wants (with e.g. %00 to reresent NUL),
> and [--shell|--perl|--python|--tcl] for placeholders in <format> to be
> quoted as string literals suitable for specified host language. 
Although
> I am not sure if this option, meant to produce scriptlets, is used that
> much/ note that there is not support for --json quoting, nor --xml 
> escaping.
-- 
Julian
Previous: Jeff KingNext: Jakub Narebski
Message 25 of 28 in “A new library for plumbing output”
  1. 0/4 A new library for plumbing outputJulian Phillips, Apr 11, 2010
  2. 1/4 output: Add a new library for plumbing outputJulian Phillips, Apr 11, 2010
  3. Ilari LiusvaaraApr 13, 2010
  4. Julian PhillipsApr 13, 2010
  5. 2/4 ls-tree: complete conversion to using output libraryJulian Phillips, Apr 11, 2010
  6. 3/4 status: use output library for porcelain outputJulian Phillips, Apr 11, 2010
  7. 4/4 output: WIP: Add XML backendJulian Phillips, Apr 11, 2010
  8. Sverre RabbelierApr 11, 2010
  9. Eric RaymondApr 12, 2010
  10. Jakub NarebskiApr 14, 2010
  11. Sverre RabbelierApr 14, 2010
  12. Jakub NarebskiApr 14, 2010
  13. Junio C HamanoApr 14, 2010
  14. Jakub NarebskiApr 14, 2010
  15. Junio C HamanoApr 14, 2010
  16. Jakub NarebskiApr 14, 2010
  17. Junio C HamanoApr 14, 2010
  18. Jeff KingApr 15, 2010
  19. Jakub NarebskiApr 15, 2010
  20. Jeff KingApr 17, 2010
  21. Jakub NarebskiApr 17, 2010
  22. Jeff KingApr 17, 2010
  23. Julian PhillipsApr 18, 2010
  24. Jeff KingApr 19, 2010
  25. Julian PhillipsApr 14, 2010
  26. Jakub NarebskiApr 14, 2010
  27. Julian PhillipsApr 14, 2010
  28. Jeff KingApr 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.