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

Re: [RFC/PATCH] status: Add a new NUL separated output format

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 10, 2010, 20:34 UTC
Message-ID
<1702f7c7b0e0689149702335c9efad3f@212.159.54.234>
In-Reply-To
<20100410195003.GA28871@thyrsus.com>
On Sat, 10 Apr 2010 15:50:03 -0400, Eric Raymond <esr@thyrsus.com> wrote:
Show 10 quoted lines
> Julian Phillips <julian@quantumfyre.co.uk>:
>> Add a new output format option to git-status that is a more extreme
>> form of the -z output that places a NUL between all parts of the
>> record, and always has three entries per record, even when only two
>> are relevant.  This make the parsing of --porcelain output much
>> simpler for the consumer.
> 
> If you're open to changing this to lose the exiguous "-> " and use "-"
> instead of " " as a status character, that would make me happy 
> and fix the rest of the design problems with the format.

If you use "--porcelain -Z" then you don't get the "->", the format is always XY<NUL><file1><NUL><file2><NUL>, with <file2> being an empty string if only file1 is relevant.

I didn't use "-" instead of " " as that seemed out of scope for a output formatting option. Though I don't personally have an objection to it, I also don't see a particularly strong need for it as with the -Z format there is no ambiguity.

If you're talking about the output without -Z, then changing the format raises compatibility issues, and were talking about something more like --porcelain2 or --porcelain=new and I don't know if that would be considered acceptable.

-- 
Julian
Previous: Eric RaymondNext: Eric Raymond
Message 17 of 19 in “git status --porcelain is a mess that needs fixing”
  1. Eric RaymondApr 9, 2010
  2. Junio C HamanoApr 9, 2010
  3. Jeff KingApr 10, 2010
  4. Jonathan NiederApr 10, 2010
  5. Jonathan NiederApr 10, 2010
  6. Jeff KingApr 10, 2010
  7. Jonathan NiederApr 10, 2010
  8. Jeff KingApr 10, 2010
  9. Eric RaymondApr 10, 2010
  10. Julian PhillipsApr 10, 2010
  11. Eric RaymondApr 10, 2010
  12. Jon SeymourApr 10, 2010
  13. Julian PhillipsApr 10, 2010
  14. Jon SeymourApr 10, 2010
  15. status: Add a new NUL separated output formatJulian Phillips, Apr 10, 2010
  16. Eric RaymondApr 10, 2010
  17. Julian PhillipsApr 10, 2010
  18. Eric RaymondApr 10, 2010
  19. status: Add json output formatJulian Phillips, Apr 10, 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.