{"thread":{"id":"55396","subject":"exporting git commands in parsable format for constructing language-specific API for git CLI","startedAt":"2021-03-27T00:43:21Z","lastAt":"2021-04-07T20:42:31Z","messageCount":4,"participants":["ama bamo","Santiago Torres Arias","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"420291","messageId":"CAJxd1DPcCD96NSqzXvh3cgA93d1nCNFQbFWduTCqfx1zi_1o=w@mail.gmail.com","threadId":"55396","inReplyTo":null,"subject":"exporting git commands in parsable format for constructing language-specific API for git CLI","fromName":"ama bamo","fromEmail":"pythoncontrol@gmail.com","sentAt":"2021-03-27T00:42:09Z","receivedAt":"2021-03-27T00:43:21Z","isPatch":false,"sender":{"key":"pythoncontrol@gmail.com","avatar":null},"body":"While using git commands in my applications and reimplementing the\nsame stuff i found out i can just parse git docs then generate\nstructures and classes based on that; i have done similiar for\nwordpress and its `wp-cli`, for example see:\nhttps://github.com/bukowa/gowpcli/tree/master/generated\n\nBut `wp-cli` allows exporting all of the commands in a json format,\nsee: https://github.com/bukowa/gowpcli/blob/master/generate/dump.json\n\nIs there anyone who thinks that would be benefical to do something\nsimiliar for git, or maybe there's something done already and i missed\nthat? (parsing manpages / generated htmldocs is still a pain).\n\nThank you,\nMateusz Kurowski\n"},{"id":"420424","messageId":"YGEMMyAYVlzgv79G@meme-cluster","threadId":"55396","inReplyTo":"CAJxd1DPcCD96NSqzXvh3cgA93d1nCNFQbFWduTCqfx1zi_1o=w@mail.gmail.com","subject":"Re: exporting git commands in parsable format for constructing language-specific API for git CLI","fromName":"Santiago Torres Arias","fromEmail":"santiago@nyu.edu","sentAt":"2021-03-28T23:07:31Z","receivedAt":"2021-03-28T23:08:23Z","isPatch":false,"sender":{"key":"santiago@nyu.edu","avatar":"https://avatars.githubusercontent.com/u/3579933?v=4"},"body":"On Sat, Mar 27, 2021 at 01:42:09AM +0100, ama bamo wrote:\n> While using git commands in my applications and reimplementing the\n> same stuff i found out i can just parse git docs then generate\n> structures and classes based on that; i have done similiar for\n> wordpress and its `wp-cli`, for example see:\n> https://github.com/bukowa/gowpcli/tree/master/generated\n> \n> But `wp-cli` allows exporting all of the commands in a json format,\n> see: https://github.com/bukowa/gowpcli/blob/master/generate/dump.json\n\nI'm not entirely sure if something like this exists in git, and I'm\nalsot unsure of what exactly is the benefit of doing so vs an actual API\n(e.g., git2go[1]). Could you help us by elaborating what this is meant to\nachieve? Maybe that way we can figure out if something exists...\n\nCheers!\n-Santiago\n\n[1] https://github.com/libgit2/git2go\n"},{"id":"421134","messageId":"CAJxd1DNB=OGgNkLHg=2TpQxgWKp1dTcg5vvFXG7+2MS0KyXjJA@mail.gmail.com","threadId":"55396","inReplyTo":"YGEMMyAYVlzgv79G@meme-cluster","subject":"Re: exporting git commands in parsable format for constructing language-specific API for git CLI","fromName":"ama bamo","fromEmail":"pythoncontrol@gmail.com","sentAt":"2021-04-07T18:18:31Z","receivedAt":"2021-04-07T18:18:47Z","isPatch":false,"sender":{"key":"pythoncontrol@gmail.com","avatar":null},"body":"Hey Santiago!\n\nSorry for not being more specific - it's my first time in such a mailing list.\n\nlibgit2 and it's language-specific API looks interesting but\nits not the solution to the problem i am trying to solve.\n\nI believe that git CLI is the most stable,reliable and tested way\nof actually using git. Most of the tools using git that i know\nare actually using your underlying git cli binary - not the bindings.\n\nBy following the definition of CLI and API; the CLI is human readable\nwhile the API is machine readable. If we were able to expose CLI\nin a machine-readable format then would it be an API?\n\n\nOn Mon, Mar 29, 2021 at 1:07 AM Santiago Torres Arias <santiago@nyu.edu> wrote:\n>\n> On Sat, Mar 27, 2021 at 01:42:09AM +0100, ama bamo wrote:\n> > While using git commands in my applications and reimplementing the\n> > same stuff i found out i can just parse git docs then generate\n> > structures and classes based on that; i have done similiar for\n> > wordpress and its `wp-cli`, for example see:\n> > https://github.com/bukowa/gowpcli/tree/master/generated\n> >\n> > But `wp-cli` allows exporting all of the commands in a json format,\n> > see: https://github.com/bukowa/gowpcli/blob/master/generate/dump.json\n>\n> I'm not entirely sure if something like this exists in git, and I'm\n> alsot unsure of what exactly is the benefit of doing so vs an actual API\n> (e.g., git2go[1]). Could you help us by elaborating what this is meant to\n> achieve? Maybe that way we can figure out if something exists...\n>\n> Cheers!\n> -Santiago\n>\n> [1] https://github.com/libgit2/git2go\n"},{"id":"421150","messageId":"xmqq4kghzv0w.fsf@gitster.g","threadId":"55396","inReplyTo":"CAJxd1DNB=OGgNkLHg=2TpQxgWKp1dTcg5vvFXG7+2MS0KyXjJA@mail.gmail.com","subject":"Re: exporting git commands in parsable format for constructing language-specific API for git CLI","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-07T20:42:23Z","receivedAt":"2021-04-07T20:42:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"ama bamo <pythoncontrol@gmail.com> writes:\n\n> By following the definition of CLI and API; the CLI is human readable\n> while the API is machine readable. If we were able to expose CLI\n> in a machine-readable format then would it be an API?\n\nBoth input and output for Porcelain commands are subject to change\nto improve the end user experience for humans, which may break\nscripts that hardcodes the assumption of either the input or the\noutput at one version of Git.\n\nSo no, I wouldn't call that an API.\n"}]}