On Mon, 13 Mar, Ross Berteig wrote:

> When fossil is configured to include JSON support it has a fossil
> json command that consumes a JSON object full of command and
> arguments and returns a JSON object of results. A similar feature is
> available over HTTP(S) through URLs beginning with /json.

Ah, that's why I never got JSON to work. The input to the JSON support
is via JSON object as well?! I always assumed you can just use ordinary
command line and specify something like --json to tell fossil to output
the result of the command as a JSON object.

> Unfortunately JSON support is not configured in the default builds of 
> fossil. I often turn it on for my personal builds, because I have
> some scripts that draw from the ticket system for report writing, and
> the JSON support for reading and querying tickets works quite nicely.
> I'd personally like to see the JSON support trusted enough to be on
> by default.

Is there a reason that the default builds as available for download
have JSON support not enabled?

> Also, not every command is available via JSON, and I suspect that
> there is no JSON equivalent to fossil annotate. If we can figure out
> how to represent the annotate/blame/praise data in JSON, then adding
> it should be possible.

I can tell you how JSON output of IBM Rational Team Concert (which is a
complete mess, but has wonderful JSON output) looks like for the
annotate command for a specific file:

{
    "annotations": [
        {
            "author": "author of commit changing line 1 last",
            "comment": "commit message of commit changing line 1 last",
            "line": "file content of line 1",
            "line-no": "1",
            "modified": "timestamp of commit changing line 1 last",
            "uuid": "revision hash of commit changing line 1 last",
        },
        {
            "author": "author of commit changing line 2 last",
            "comment": "commit message of commit changing line 2 last",
            "line": "file content of line 2",
            "line-no": "2",
            "modified": "timestamp of commit changing line 2 last",
            "uuid": "revision hash of commit changing line 2 last",
        },
        {
            "author": "author of commit changing line 3 last",
            "comment": "commit message of commit changing line 3 last",
            "line": "file content of line 3",
            "line-no": "3",
            "modified": "timestamp of commit changing line 3 last",
            "uuid": "revision hash of commit changing line 3 last",
        },
...
    ]
}

I hope this helps a bit.

Greetings,
Stefan

-- 
Stefan Bellon
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to