)]}'
{
  "commit": "ced04955982bd5af9cb9e72a59cf9dd26c326e98",
  "tree": "aec4b548614cb71e4520eacdabc28cd76ba98029",
  "parents": [
    "dc32c23f488f5512fcadbd7b62262ed8e001b5b9"
  ],
  "author": {
    "name": "yashanil98",
    "email": "79158725+yashanil98@users.noreply.github.com",
    "time": "Mon Aug 17 08:47:39 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Aug 17 08:55:10 2026 -0700"
  },
  "message": "fix(protoc): honor --fatal_warnings in encode/decode mode (#28033)\n\nFixes #10486.\n\nWhen an input message passed to `protoc --encode` or `--decode` is missing required fields, protoc prints `warning: Input message is missing required fields: ...`. That warning was written straight to stderr in `EncodeOrDecode` and never influenced the exit code, so protoc returned 0 even with `--fatal_warnings` set, defeating its `-Werror`-like purpose.\n\nThis makes `EncodeOrDecode` return a non-zero exit when `--fatal_warnings` is set and the message is missing required fields. The check happens after the output is written, matching the compile path (which also produces its output before failing). When `--fatal_warnings` is not set, behavior is unchanged: the output and the warning are still produced and the exit code stays 0.\n\nA maintainer confirmed this is a valid bug and invited a PR on the issue.\n\nTest: added `EncodeDecodeTest.PartialWithFatalWarnings` asserting a non-zero exit (and that the warning is still emitted) when encoding a message with missing required fields under `--fatal_warnings`.\n\n  ./build/tests --gtest_filter\u003d\u0027*EncodeDecodeTest.*\u0027\n\nResult: 18 tests pass, including the new one.\n\nCloses #28033\n\nCOPYBARA_INTEGRATE_REVIEW\u003dhttps://github.com/protocolbuffers/protobuf/pull/28033 from yashanil98:fix/issue-10486-fatal-warnings-encode-decode d0bb423371baeca387fa8afbeabed597d8e52060\nPiperOrigin-RevId: 965995070\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e3f6d7d73bb03b66288b88f327a0a26dbf05dd41",
      "old_mode": 33188,
      "old_path": "src/google/protobuf/compiler/command_line_interface.cc",
      "new_id": "83ae959e72ad0b00d03c29f697b9e3ee0b872995",
      "new_mode": 33188,
      "new_path": "src/google/protobuf/compiler/command_line_interface.cc"
    },
    {
      "type": "modify",
      "old_id": "c5352884bc41e6748f1e5105e3aee69c83e97195",
      "old_mode": 33188,
      "old_path": "src/google/protobuf/compiler/command_line_interface_unittest.cc",
      "new_id": "30563870d823048bf6e351462fbf0fb08dfb3ed7",
      "new_mode": 33188,
      "new_path": "src/google/protobuf/compiler/command_line_interface_unittest.cc"
    }
  ]
}
