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, 21:28 UTC
Message-ID
<0e50c39792144f5cb18260009384b4d0@212.159.54.234>
In-Reply-To
<201004142316.07947.jnareb@gmail.com>

On Wed, 14 Apr 2010 23:16:06 +0200, Jakub Narebski <jnareb@gmail.com> wrote:

Show 5 quoted lines
> On Wed,  14 Apr 2010, Julian Phillips wrote:
>> On Wed, 14 Apr 2010 21:10:35 +0200, Jakub Narebski <jnareb@gmail.com>
>> wrote:
>> 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
Show 6 quoted lines
>> the patch series.  So you can try before you buy ...
> 
> Nice.
> 
> How did you managed to work with a bit non-standard rules of --porcelain
> format, namely maybe-quoting of filenames, and that not all lines
conform
> to "<header> SP <value> LF" syntax: group definition begins with SHA-1,
> and contents is indented with TAB?

I had to extend the output API for quoting rules. There are now qstr/qstrf output functions that call different backend functions. The normal output then applies git quoting rules to the q versions only, whereas the JSON output treats them both the same.

For the rest of it, only the actual data is going through the output_str etc functions the rest is using output_token that is ignored by the JSON backend. I actually started converting blame twice - the first time I added an API function that allowed telling the normal output how to format values, but I decided that I wanted to apply grouping to the structured output, so that e.g. the author and committer information were two objects with name, mail, date and tz members so I never finished the first attempt.

-- 
Julian
Previous: Jakub NarebskiNext: Jeff King
Message 27 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.