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

Support JSON with --json flag and provide header files

From
Alexander Mills <alexander.d.mills@gmail.com>
Date
Aug 7, 2018, 04:54 UTC
Message-ID
<CA+KyZp5i8KzaAnet1eQovkxS2wLHUfnhZT04GCm2eXSFBqO+Fg@mail.gmail.com>
@git

I hear there is a movement underway to have git support JSON for the purposes of machine readable stdio.

That is all good and well. I want to add to that request. Imagine a software world were serialized data could be typed. So JSON produced by C/C++ could be described and the receiving process could have type information about how the JSON would be deserialized.

How would that work? For every typed language, Git would provide header files for that language that include type information for each JSON string that would be produced by git commands.

How could that be accomplished? Someone needs to create a system to generate type information (header files) for each language based off a single central format. So we create a JSON format that describes the JSON data. And from that single format we generate header files for each typed language.

I hope you see the value in that. There could be a git command that generates the header files for a given language, given the git version:

$ git --generate-header-files --language=java > $dir

the above command would generate the right header files for Java given the git version. Or the headers could be stored on the www and could be downloadable for each git version. Perhaps Git authors wouldn't do all this work - perhaps they just author a JSON format that describes JSON. And the OSS community can write tools that convert the JSON format into header files for each language. But I would like something OFFICIAL to take place here.

Hope this makes sense. I am looking forward to a software future where parsing stdio is easier by using machine readable JSON. Want human readable output? Use the regular command. Want machine readable output? use the --json flag.

-alex
-- 
Alexander D. Mills
¡¡¡ New cell phone number: (415)730-1805 !!!
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/
Next: Alexander Mills
Message 1 of 2 in “Support JSON with --json flag and provide header files”
  1. Alexander MillsAug 7, 2018
  2. Alexander MillsAug 7, 2018

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.