)]}'
{
  "commit": "623f7af28417805d941b1618157b9d93c02347af",
  "tree": "b3fc64acf7676fe1e1d45e3520409b5df7210169",
  "parents": [
    "1e0a3e8f8f9e160b21fbe6f3f11a11dbed15fb4e"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Fri Oct 17 04:36:41 2025 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Oct 17 11:41:50 2025 -0700"
  },
  "message": "diff: restore redirection to /dev/null for diff_from_contents\n\nIn --quiet mode, since we produce only an exit code for \"something was\nchanged\" and no actual output, we can often get by with just a\ntree-level diff. However, certain options require us to actually look at\nthe file contents (e.g., if we are ignoring whitespace changes). We have\na flag \"diff_from_contents\" for that, and if it is set we call\ndiff_flush() on each path.\n\nTo avoid producing any output (since we were asked to be --quiet), we\ntraditionally just redirected the output to /dev/null. That changed in\nb55e6d36eb (diff: ensure consistent diff behavior with ignore options,\n2025-08-08), which replaced that with a \"dry_run\" flag. In theory, with\ndry_run set, we should produce no output. But it carries a risk of\nregression: if we forget to respect dry_run in any of the output paths,\nwe\u0027ll accidentally produce output.\n\nAnd indeed, there is at least one such regression in that commit, as it\ncovered only the case where we actually call into xdiff, and not\ncreation or deletion diffs, where we manually generate the headers. We\neven test this case in t4035, but only with diff-tree, which does not\nshow the bug by default because it does not require diff_from_contents.\nBut git-diff does, because it allows external diff programs by default\n(so we must dig into each diff filepair to decide if it requires running\nan external diff that may declare two distinct blobs to actually be the\nsame).\n\nWe should fix all of those code paths to respect dry_run correctly, but\nin the meantime we can protect ourselves more fully by restoring the\nredirection to /dev/null. This gives us an extra layer of protection\nagainst regressions dues to other code paths we\u0027ve missed.\n\nThough the original issue was reported with \"git diff\" (and due to its\ndefault of --ext-diff), I\u0027ve used \"diff-tree -w\" in the new test. It\ntriggers the same issue, but I think the fact that \"-w\" implies\ndiff_from_contents is a bit more obvious, and fits in with the rest of\nt4035.\n\nReported-by: Jake Zimmerman \u003cjake@zimmerman.io\u003e\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cb04a9a6f26f5cbf163e5b459af6a27572464c1e",
      "old_mode": 33188,
      "old_path": "diff.c",
      "new_id": "9b8d658b9ebb8e92f4e4b4c8c177529f47a22c92",
      "new_mode": 33188,
      "new_path": "diff.c"
    },
    {
      "type": "modify",
      "old_id": "0352bf81a90a38adf14fb7a980c98600e1f650b2",
      "old_mode": 33261,
      "old_path": "t/t4035-diff-quiet.sh",
      "new_id": "35eaf0855f86a55b23ccca1ec40cd406b48245b1",
      "new_mode": 33261,
      "new_path": "t/t4035-diff-quiet.sh"
    }
  ]
}
