)]}'
{
  "commit": "fd29d7b9d767296e0f8fbd3f7def735424fdbb30",
  "tree": "0dfeba301af76aa8835db927062e1ff34eabfb04",
  "parents": [
    "0f59128f7bb6ce20889156efd101d1e059377eaa"
  ],
  "author": {
    "name": "SZEDER Gábor",
    "email": "szeder.dev@gmail.com",
    "time": "Thu Feb 08 16:56:55 2018 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Feb 08 10:54:27 2018 -0800"
  },
  "message": "t: validate \u0027test_i18ngrep\u0027s parameters\n\nSome of the previous patches in this series fixed bogus\n\u0027test_i18ngrep\u0027 invocations:\n\n  - Two invocations where the tested git command\u0027s standard output is\n    directly piped into \u0027test_i18ngrep\u0027.  While convenient, this is an\n    antipattern, because the pipe hides the git command\u0027s exit code,\n    and the test could continue even if the command exited with error.\n\n  - Two invocations that had neither a filename parameter nor anything\n    piped into their standard input, yet both managed to remain\n    unnoticed for years.  A third similarly bogus invocation is\n    currently lurking in \u0027pu\u0027 for a couple of weeks now.\n\nPrevent similar mistakes in the future by validating \u0027test_i18ngrep\u0027s\nparameters requiring that\n\n  - The last parameter names an existing file to be read, effectively\n    forbidding piping into \u0027test_i18ngrep\u0027.\n\n    Note that this change will also forbid cases where \u0027test_i18ngrep\u0027\n    would legitimately read its standard input, e.g. when its standard\n    input is redirected from a file, or when a git command\u0027s standard\n    output is first written to an intermediate file, which is then\n    preprocessed by a non-git command before the results are piped\n    into \u0027test_i18ngrep\u0027.  See two of the previous patches for the\n    only such cases we had in our test suite.  However, reliably\n    preventing the piping antipattern is arguably more important than\n    supporting these cases, which can be easily worked around by\n    opening the file directly or using an intermediate file anyway.\n\n  - There are at least two parameters, not including the optional \u0027!\u0027\n    to negate the pattern.  This ought to catch corner cases when\n    \u0027test_i18ngrep\u0027 looks for the name of an existing file on its\n    standard input; the above check would miss this case becase the\n    filename as pattern would be the last parameter.\n\n    Note that this is not quite perfect, as it doesn\u0027t account for any\n    \u0027grep --options\u0027 given as parameters.  However, doing so would be\n    far too complicated, considering that patterns can start with\n    dashes as well, and in the majority of the cases we don\u0027t use any\n    such options anyway.\n\nSigned-off-by: SZEDER Gábor \u003cszeder.dev@gmail.com\u003e\nReviewed-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "92ed0293712e8875783037a32cb21252087bc589",
      "old_mode": 33188,
      "old_path": "t/test-lib-functions.sh",
      "new_id": "64f793e3d73e6f7e0ab2d813487efb0b237489d0",
      "new_mode": 33188,
      "new_path": "t/test-lib-functions.sh"
    }
  ]
}
