If I run this command:
$ git status
I get:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
This is pretty difficult to parse.
But what would be really nice is --json output, in another world, I'd love to see:
$ git status --json
and get this:
{
"currentBranch": "master",
"remoteTrackingBranch": "origin/master",
"isUpToDateWithRemote": true,
"workingDirectoryClean": true
}
is there some tool in the NPM ecosystem that can parse Git output into JSON? What is the best way to parse the output from git status
, etc?