{"thread":{"id":"45637","subject":"Feature request: --format=json","startedAt":"2017-04-08T16:07:25Z","lastAt":"2017-04-24T11:06:28Z","messageCount":14,"participants":["Fred .Flintstone","Ævar Arnfjörð Bjarmason","Junio C Hamano","Duy Nguyen","Sebastian Schuberth","Samuel Lijin","demerphq","shawn wilson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"316416","messageId":"CAJgfmqU+1Ex1YkP94H2amXV+oqscbQwvb-CueuCiM7-n0AAP8Q@mail.gmail.com","threadId":"45637","inReplyTo":null,"subject":"Feature request: --format=json","fromName":"Fred .Flintstone","fromEmail":"eldmannen@gmail.com","sentAt":"2017-04-08T16:07:18Z","receivedAt":"2017-04-08T16:07:25Z","isPatch":false,"sender":{"key":"eldmannen@gmail.com","avatar":null},"body":"$ git log --format=json\n[{\n    \"commit\": \"64eabf050e315a4c7a11e0c05ca163be7cf9075e\",\n    \"tree\": \"b1e977800f40bbf6de906b1fe4f2de4b4b14f0fd\",\n    \"author\": \"Tux <tux@example.com> 1490981516 +0200\",\n    \"committer\": \"Tux <tux@example.com> 1490981516 +0200\",\n    \"message\": \"This is a test commit\",\n    \"long_message\": \"This explains in more details the commit\"\n}]\n\nThis would make it easy to parse the output.\n"},{"id":"316417","messageId":"CACBZZX4fDu-o+ERiTyjVq2rWkXK6rjErU4KyW33qMx1_6vjMCQ@mail.gmail.com","threadId":"45637","inReplyTo":"CAJgfmqU+1Ex1YkP94H2amXV+oqscbQwvb-CueuCiM7-n0AAP8Q@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-04-08T16:26:20Z","receivedAt":"2017-04-08T16:26:47Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Apr 8, 2017 at 6:07 PM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n> $ git log --format=json\n> [{\n>     \"commit\": \"64eabf050e315a4c7a11e0c05ca163be7cf9075e\",\n>     \"tree\": \"b1e977800f40bbf6de906b1fe4f2de4b4b14f0fd\",\n>     \"author\": \"Tux <tux@example.com> 1490981516 +0200\",\n>     \"committer\": \"Tux <tux@example.com> 1490981516 +0200\",\n>     \"message\": \"This is a test commit\",\n>     \"long_message\": \"This explains in more details the commit\"\n> }]\n>\n> This would make it easy to parse the output.\n\nThe git-log command isn't plumbing that's meant for machines, but the\ngit-for-each-ref command is what you're most likely looking for.\n\nIt doesn't have JSON output, but you can make e.g. --format emit\nsomething even more easily parsable, e.g. a version of what you have\nwith each field delimited by a custom delimiter, and then split on\nthat.\n\nIt does have --perl, --tcl etc. options to make it easy to quote the\nfields, however there's no logic to manage the state machine JSON\nwould need to omit trailing commas, whereas emitting output for\nlanguages like Perl where trailing commas don't matter is much easier.\n"},{"id":"316971","messageId":"xmqqpogblvfr.fsf@gitster.mtv.corp.google.com","threadId":"45637","inReplyTo":"CACBZZX4fDu-o+ERiTyjVq2rWkXK6rjErU4KyW33qMx1_6vjMCQ@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-17T00:38:48Z","receivedAt":"2017-04-17T00:38:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> On Sat, Apr 8, 2017 at 6:07 PM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n>> $ git log --format=json\n>> [{\n>>     \"commit\": \"64eabf050e315a4c7a11e0c05ca163be7cf9075e\",\n>>     \"tree\": \"b1e977800f40bbf6de906b1fe4f2de4b4b14f0fd\",\n>>     \"author\": \"Tux <tux@example.com> 1490981516 +0200\",\n>>     \"committer\": \"Tux <tux@example.com> 1490981516 +0200\",\n>>     \"message\": \"This is a test commit\",\n>>     \"long_message\": \"This explains in more details the commit\"\n>> }]\n>>\n>> This would make it easy to parse the output.\n>\n> The git-log command isn't plumbing that's meant for machines, but the\n> git-for-each-ref command is what you're most likely looking for.\n\nThey are apples and oranges.  log is about traversing the history.\n\"for-each-ref\" is about listing the tips of refs.  It doesn't and it\nshouldn't traverse the history.\n\nThe plumbing to use when you want to reimplement \"git log\" lookalike\nis \"rev-list\".\n"},{"id":"317006","messageId":"CAJgfmqWf9j=R1=qy-kGTL4+y_40O+8S5q=VZuD3A-DbfRJer2Q@mail.gmail.com","threadId":"45637","inReplyTo":"xmqqpogblvfr.fsf@gitster.mtv.corp.google.com","subject":"Re: Feature request: --format=json","fromName":"Fred .Flintstone","fromEmail":"eldmannen@gmail.com","sentAt":"2017-04-17T12:44:13Z","receivedAt":"2017-04-17T12:44:21Z","isPatch":false,"sender":{"key":"eldmannen@gmail.com","avatar":null},"body":"So I did \"git rev-list --all --pretty\" and it looks like \"git log\".\nWhich outputs a human-readable format.\n\nHowever, if I want something more suitable for machine parsing, is\nthere any way to get that output?\n\nExample maybe I want another date format like ISO dates, or maybe a\nserializable format like JSON or CSV or something. Maybe I want more\ndata than commit, auhor, date, subject and body?\n\nOn Mon, Apr 17, 2017 at 2:38 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> On Sat, Apr 8, 2017 at 6:07 PM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n>>> $ git log --format=json\n>>> [{\n>>>     \"commit\": \"64eabf050e315a4c7a11e0c05ca163be7cf9075e\",\n>>>     \"tree\": \"b1e977800f40bbf6de906b1fe4f2de4b4b14f0fd\",\n>>>     \"author\": \"Tux <tux@example.com> 1490981516 +0200\",\n>>>     \"committer\": \"Tux <tux@example.com> 1490981516 +0200\",\n>>>     \"message\": \"This is a test commit\",\n>>>     \"long_message\": \"This explains in more details the commit\"\n>>> }]\n>>>\n>>> This would make it easy to parse the output.\n>>\n>> The git-log command isn't plumbing that's meant for machines, but the\n>> git-for-each-ref command is what you're most likely looking for.\n>\n> They are apples and oranges.  log is about traversing the history.\n> \"for-each-ref\" is about listing the tips of refs.  It doesn't and it\n> shouldn't traverse the history.\n>\n> The plumbing to use when you want to reimplement \"git log\" lookalike\n> is \"rev-list\".\n"},{"id":"317007","messageId":"CACsJy8BASVSxJ4RzNKVpj9MyD=fMR-fpspMdET1bT45yMrf_0w@mail.gmail.com","threadId":"45637","inReplyTo":"CAJgfmqWf9j=R1=qy-kGTL4+y_40O+8S5q=VZuD3A-DbfRJer2Q@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2017-04-17T12:59:48Z","receivedAt":"2017-04-17T13:00:25Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Apr 17, 2017 at 7:44 PM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n> So I did \"git rev-list --all --pretty\" and it looks like \"git log\".\n> Which outputs a human-readable format.\n>\n> However, if I want something more suitable for machine parsing, is\n> there any way to get that output?\n>\n> Example maybe I want another date format like ISO dates, or maybe a\n> serializable format like JSON or CSV or something. Maybe I want more\n> data than commit, auhor, date, subject and body?\n\n\"git cat-file commit <commit-id>\" should give you a machine-readable\nformat of everything (it's the same thing that git-log parses and\nshows you; not counting options like --diff, --stat...). <commit-id>\nis from rev-list output (without --pretty, that's not for machine\nprocessing). You probably can use \"git cat-file --batch\" too, just\npipe the whole rev-list output through it. You don't get to choose a\nconvenient format this way though.\n-- \nDuy\n"},{"id":"317008","messageId":"CAJgfmqW4ck9SwBrT_Z7bTOzM2zG==_ONUhTfhbLJtRu=vT+wyg@mail.gmail.com","threadId":"45637","inReplyTo":"CACsJy8BASVSxJ4RzNKVpj9MyD=fMR-fpspMdET1bT45yMrf_0w@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Fred .Flintstone","fromEmail":"eldmannen@gmail.com","sentAt":"2017-04-17T13:09:20Z","receivedAt":"2017-04-17T13:14:13Z","isPatch":false,"sender":{"key":"eldmannen@gmail.com","avatar":null},"body":"So I would either have to do:\ngit rev-list --all\nThen iterate over each line and do git-cat-file commit <commit-id>.\n\nOr do:\ngit rev-list --all | git cat-file --batch\n\nIf I do it in a batch, then it will be tricky to reliably parse since\nI don't know when the message body ends and when the next commit\nstarts.\n\nJSON output would have been very handy.\n\nOn Mon, Apr 17, 2017 at 2:59 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Mon, Apr 17, 2017 at 7:44 PM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n>> So I did \"git rev-list --all --pretty\" and it looks like \"git log\".\n>> Which outputs a human-readable format.\n>>\n>> However, if I want something more suitable for machine parsing, is\n>> there any way to get that output?\n>>\n>> Example maybe I want another date format like ISO dates, or maybe a\n>> serializable format like JSON or CSV or something. Maybe I want more\n>> data than commit, auhor, date, subject and body?\n>\n> \"git cat-file commit <commit-id>\" should give you a machine-readable\n> format of everything (it's the same thing that git-log parses and\n> shows you; not counting options like --diff, --stat...). <commit-id>\n> is from rev-list output (without --pretty, that's not for machine\n> processing). You probably can use \"git cat-file --batch\" too, just\n> pipe the whole rev-list output through it. You don't get to choose a\n> convenient format this way though.\n> --\n> Duy\n"},{"id":"317015","messageId":"c56a5582-81a1-3714-4587-f6a12b4365bd@gmail.com","threadId":"45637","inReplyTo":"CAJgfmqWf9j=R1=qy-kGTL4+y_40O+8S5q=VZuD3A-DbfRJer2Q@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2017-04-17T17:35:51Z","receivedAt":"2017-04-17T17:36:04Z","isPatch":false,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On 2017-04-17 14:44, Fred .Flintstone wrote:\n\n> However, if I want something more suitable for machine parsing, is\n> there any way to get that output?\n\nInstead of machine parsing, why not directly get what you want via \nlibgit2 (or one of its language bindings), or jgit?\n\n[1] https://github.com/libgit2/libgit2\n[2] https://github.com/eclipse/jgit\n\n-- \nSebastian Schuberth\n\n"},{"id":"317055","messageId":"xmqq60i2im72.fsf@gitster.mtv.corp.google.com","threadId":"45637","inReplyTo":"CAJgfmqW4ck9SwBrT_Z7bTOzM2zG==_ONUhTfhbLJtRu=vT+wyg@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-04-18T00:38:57Z","receivedAt":"2017-04-18T00:39:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Fred .Flintstone\" <eldmannen@gmail.com> writes:\n\n> So I would either have to do:\n> git rev-list --all\n> Then iterate over each line and do git-cat-file commit <commit-id>.\n>\n> Or do:\n> git rev-list --all | git cat-file --batch\n>\n> If I do it in a batch, then it will be tricky to reliably parse since\n> I don't know when the message body ends and when the next commit\n> starts.\n>\n> JSON output would have been very handy.\n\nI am somewhat puzzled.  I thought that you were trying to come up\nwith a way to produce JSON output and people are trying to help you\nby pointing out tools that you can use for that.\n"},{"id":"317087","messageId":"CAJgfmqXqfp3A+A74dfkKjQb_26ZNH9anY52-G2L5ipg=+6--2w@mail.gmail.com","threadId":"45637","inReplyTo":"xmqq60i2im72.fsf@gitster.mtv.corp.google.com","subject":"Re: Feature request: --format=json","fromName":"Fred .Flintstone","fromEmail":"eldmannen@gmail.com","sentAt":"2017-04-18T08:44:04Z","receivedAt":"2017-04-18T08:47:07Z","isPatch":false,"sender":{"key":"eldmannen@gmail.com","avatar":null},"body":"Well the easiest way to work with that would be JSON.\nSo the best would be if Git could output the data I want in JSON format.\nThen it would be easy for me to work with data.\n\nWith git rev-list and git-cat file, its not so easy to reliably parse\nthat output.\n\nOn Tue, Apr 18, 2017 at 2:38 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Fred .Flintstone\" <eldmannen@gmail.com> writes:\n>\n>> So I would either have to do:\n>> git rev-list --all\n>> Then iterate over each line and do git-cat-file commit <commit-id>.\n>>\n>> Or do:\n>> git rev-list --all | git cat-file --batch\n>>\n>> If I do it in a batch, then it will be tricky to reliably parse since\n>> I don't know when the message body ends and when the next commit\n>> starts.\n>>\n>> JSON output would have been very handy.\n>\n> I am somewhat puzzled.  I thought that you were trying to come up\n> with a way to produce JSON output and people are trying to help you\n> by pointing out tools that you can use for that.\n"},{"id":"317093","messageId":"CAJZjrdXBbBiy0f=RJ2m7iHnh70Nz97-tdHWkSJtYbW6CKBr5ow@mail.gmail.com","threadId":"45637","inReplyTo":"CAJgfmqXqfp3A+A74dfkKjQb_26ZNH9anY52-G2L5ipg=+6--2w@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Samuel Lijin","fromEmail":"sxlijin@gmail.com","sentAt":"2017-04-18T09:39:38Z","receivedAt":"2017-04-18T09:40:25Z","isPatch":false,"sender":{"key":"sxlijin@gmail.com","avatar":"https://gravatar.com/avatar/01777bf1eae64e2b4dca97dcac182a6abbcf6fd8cb4d5b8fa33edf9f8cc21746?d=mp&s=160"},"body":"If for some reason your use case is so performance intensive that you\ncan't just `git cat-file commit` every entry in `git rev-list --all`\nindividually, then you can also pipe input into `git cat-file --batch`\nand read output as you pipe input in, which will give you a very\nsimple mechanism for delimiting the cat-file output.\n\nIn any case, as developers, it's rare to have our job done for us.\nThat's why we write code.\n\nI'm sure people would be happy to help if you submitted patches to\nsupport --format=json.\n\nOn Tue, Apr 18, 2017 at 3:44 AM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n> Well the easiest way to work with that would be JSON.\n> So the best would be if Git could output the data I want in JSON format.\n> Then it would be easy for me to work with data.\n>\n> With git rev-list and git-cat file, its not so easy to reliably parse\n> that output.\n>\n> On Tue, Apr 18, 2017 at 2:38 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> \"Fred .Flintstone\" <eldmannen@gmail.com> writes:\n>>\n>>> So I would either have to do:\n>>> git rev-list --all\n>>> Then iterate over each line and do git-cat-file commit <commit-id>.\n>>>\n>>> Or do:\n>>> git rev-list --all | git cat-file --batch\n>>>\n>>> If I do it in a batch, then it will be tricky to reliably parse since\n>>> I don't know when the message body ends and when the next commit\n>>> starts.\n>>>\n>>> JSON output would have been very handy.\n>>\n>> I am somewhat puzzled.  I thought that you were trying to come up\n>> with a way to produce JSON output and people are trying to help you\n>> by pointing out tools that you can use for that.\n"},{"id":"317094","messageId":"CAJgfmqX_syWNOno+sKm5PpsbZQkP7VPTp_qraG-Pwv9gjias5w@mail.gmail.com","threadId":"45637","inReplyTo":"CAJZjrdXBbBiy0f=RJ2m7iHnh70Nz97-tdHWkSJtYbW6CKBr5ow@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Fred .Flintstone","fromEmail":"eldmannen@gmail.com","sentAt":"2017-04-18T10:08:25Z","receivedAt":"2017-04-18T10:08:33Z","isPatch":false,"sender":{"key":"eldmannen@gmail.com","avatar":null},"body":"But a repository or branch can have thousands of commits, so running\n`git commit-file <commit>` seems maybe not be a wide idea.\nBut parsing `git cat-file --batch` is difficult, because there seems\nto be no reliable way to discern when a commit starts and ends.\n\nI don't code in C though. A JSON formatter option would need a JSON library.\nBut maybe there should be raised a discussion about JSON in Git if\nthere are other people interested in this?\n\nOn Tue, Apr 18, 2017 at 11:39 AM, Samuel Lijin <sxlijin@gmail.com> wrote:\n> If for some reason your use case is so performance intensive that you\n> can't just `git cat-file commit` every entry in `git rev-list --all`\n> individually, then you can also pipe input into `git cat-file --batch`\n> and read output as you pipe input in, which will give you a very\n> simple mechanism for delimiting the cat-file output.\n>\n> In any case, as developers, it's rare to have our job done for us.\n> That's why we write code.\n>\n> I'm sure people would be happy to help if you submitted patches to\n> support --format=json.\n>\n> On Tue, Apr 18, 2017 at 3:44 AM, Fred .Flintstone <eldmannen@gmail.com> wrote:\n>> Well the easiest way to work with that would be JSON.\n>> So the best would be if Git could output the data I want in JSON format.\n>> Then it would be easy for me to work with data.\n>>\n>> With git rev-list and git-cat file, its not so easy to reliably parse\n>> that output.\n>>\n>> On Tue, Apr 18, 2017 at 2:38 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> \"Fred .Flintstone\" <eldmannen@gmail.com> writes:\n>>>\n>>>> So I would either have to do:\n>>>> git rev-list --all\n>>>> Then iterate over each line and do git-cat-file commit <commit-id>.\n>>>>\n>>>> Or do:\n>>>> git rev-list --all | git cat-file --batch\n>>>>\n>>>> If I do it in a batch, then it will be tricky to reliably parse since\n>>>> I don't know when the message body ends and when the next commit\n>>>> starts.\n>>>>\n>>>> JSON output would have been very handy.\n>>>\n>>> I am somewhat puzzled.  I thought that you were trying to come up\n>>> with a way to produce JSON output and people are trying to help you\n>>> by pointing out tools that you can use for that.\n"},{"id":"317096","messageId":"CANgJU+WbbF2yzg53D7NasN_nxqytOh=UoutmMPak77JhiJHx4A@mail.gmail.com","threadId":"45637","inReplyTo":"CAJgfmqXqfp3A+A74dfkKjQb_26ZNH9anY52-G2L5ipg=+6--2w@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2017-04-18T11:16:50Z","receivedAt":"2017-04-18T11:16:58Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On 18 April 2017 at 10:44, Fred .Flintstone <eldmannen@gmail.com> wrote:\n> Well the easiest way to work with that would be JSON.\n> So the best would be if Git could output the data I want in JSON format.\n> Then it would be easy for me to work with data.\n>\n> With git rev-list and git-cat file, its not so easy to reliably parse\n> that output.\n\nDoesn't seem too hard to work with rev-list to me. As far as I can\ntell the following produces what  you want. You need perl installed\nobviously, and the JSON::PP module is required, but should come\nbundled with recent perls.\n\ngit rev-list master --pretty=raw | perl -MJSON::PP=encode_json\n-ane'if(/^(\\w+) (.*)/) { if ($1 eq \"commit\") { push @objs, $o if $o;\n$o={}; } $o->{$1} = $2; } else { $o->{text} .= $_; } END{ push @objs,\n$o if $o; for $o (@objs) { s/^    //mg, s/^\\n// for $o->{text};\n($o->{message},$o->{long_message})= split /\\n\\n/, delete $o->{text}; }\nprint JSON::PP->new->pretty->encode(\\@objs);}'\n\nYou might consider an alternative approach than stating that working\nwith JSON is \"the easiest\", especially to people who clearly are\nmaking do without it. :-)\n\nA better argument might be that exposing data through a well defined\nand widely used and simple data format would trivially expand the\nrange of projects that might interoperate with git or enhance the git\necosystem. For instance you could argue that having clean JSON output\nwould make it easier to integrate into search engines and other\nindexing tools that already know how to speak JSON. Maybe a regular\ncontributor on this list might agree with your arguments and make it\nhappen.\n\nUntil then you can parse rev-list like the rest of us. :-)\n\ncheers,\nYves\n"},{"id":"317652","messageId":"CACsJy8DPtfyAAX_cmRLib=eKPMWnew5CsYDV6V3xTTiEg1Kksg@mail.gmail.com","threadId":"45637","inReplyTo":"CAH_OBidR8ewMO_B0HM2SU=B+uV=kRjpOKVMcvohEkZ1PSgT92w@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2017-04-24T09:28:15Z","receivedAt":"2017-04-24T09:29:00Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Apr 24, 2017 at 3:33 PM, shawn wilson <ag4ve.us@gmail.com> wrote:\n> Late to the party, but I too would also like json format output (mainly so I\n> could pipe stuff to jq instead of looking at the man page for which %thing\n> I'm looking for). That said, it's not at the PR level of want for me.\n>\n> OTOH, format=xml would be even more handy IMHO... Which I see has hit both\n> SO and this ml in the past. Either way /some/ machine output would be a good\n> thing :)\n\nPersonally I'd rather avoid linking to another library just for\njson/xml formatting. libgit2 would be a great place to have\nfunctionality like this and it looks like you don't even have to touch\nC [1] to do that.\n\n[1] https://gist.github.com/m1el/42472327b4be382b02eb\n-- \nDuy\n"},{"id":"317666","messageId":"CAH_OBid8nNGX2fFJkGcS1=bDQBjMvXn4ZeJ9wJ4VNGOMh-AeRQ@mail.gmail.com","threadId":"45637","inReplyTo":"CACsJy8DPtfyAAX_cmRLib=eKPMWnew5CsYDV6V3xTTiEg1Kksg@mail.gmail.com","subject":"Re: Feature request: --format=json","fromName":"shawn wilson","fromEmail":"ag4ve.us@gmail.com","sentAt":"2017-04-24T11:04:10Z","receivedAt":"2017-04-24T11:06:28Z","isPatch":false,"sender":{"key":"ag4ve.us@gmail.com","avatar":null},"body":"On Mon, Apr 24, 2017 at 5:28 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Mon, Apr 24, 2017 at 3:33 PM, shawn wilson <ag4ve.us@gmail.com> wrote:\n>> Late to the party, but I too would also like json format output (mainly so I\n>> could pipe stuff to jq instead of looking at the man page for which %thing\n>> I'm looking for). That said, it's not at the PR level of want for me.\n>>\n>> OTOH, format=xml would be even more handy IMHO... Which I see has hit both\n>> SO and this ml in the past. Either way /some/ machine output would be a good\n>> thing :)\n>\n> Personally I'd rather avoid linking to another library just for\n> json/xml formatting. libgit2 would be a great place to have\n> functionality like this and it looks like you don't even have to touch\n> C [1] to do that.\n>\n> [1] https://gist.github.com/m1el/42472327b4be382b02eb\n\n\nHeh, well, I guess if it's like that (simple), I don't really care :)\nI was under the impression (no idea why) that it was limited to C or\njava (and friends). Given this means I don't have to figure out\nsomeone's json structure or refer to an xsd, I'll live w/ this.\n"}]}