The sound distributed version control system

#643 `pijul diff --json` might better output JSON array instead of JSON object

Opened by mstrap on January 31, 2022
mstrap on January 31, 2022

pijul diff --json seems to be slightly inconsistent with other commands by reporting the files as a JSON object instead of a JSON array (as e.g. pijul --log --output-format=json does). pijul diff --untracked --json reports an array, as expected. Current output:

{
  "CHANGELOG.md": [
    {
      "operation": "edit",
      "line": 1
    }
  ],
  "README.md": [
    {
      "operation": "edit",
      "line": 1
    }
  ]
}

More appropriate might be something like:

[
  {
    name: "CHANGELOG.md",
    diff: [
      {
        "operation": "edit",
        "line": 1
      }
    ],
  },
  {
    name: "README.md",
    diff: [
      {
        "operation": "edit",
        "line": 1
      }
    ],
  }
]
maisiliym on March 23, 2022

That would increase size without adding any data.