)]}'
{
  "commit": "e14e2b6cf2db2ebde3cb5c4d953899c5f014253e",
  "tree": "0a743513d96dc8543f7efe1d80bd45c2ec649bbe",
  "parents": [
    "f97936288dabcba0d85bb2d5128a8b4dce1014e7"
  ],
  "author": {
    "name": "Patrick Steinhardt",
    "email": "ps@pks.im",
    "time": "Thu Oct 01 07:39:02 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Thu Oct 01 06:38:46 2026 -0700"
  },
  "message": "refs/reftable: fix on-disk representation of reflog timezones\n\nWhen writing reflog entries to disk we also record authorship\ninformation for the reflog. Besides the author name and mail address,\nit also contains the date and timezone at which the record has been\ncreated.\n\nThe timezone information is typically encoded in the \"[+-]HHMM\" format,\nand we often pass it around as parsed integer. For example, the timezone\n\"-0700\" would be passed around as -700. And this is also the value that\nwe eventually store in the reftable on disk.\n\nBut the specification in \"Documentation/technical/reftable.adoc\" notes\nthat the timezone is a \"2-byte timezone offset in minutes (signed)\". So\ninstead of storing -700 in the above example, we have to first convert\nthat value into minutes and then store -420. We don\u0027t though, so we have\na mismatch between specification and implementation.\n\nIdeally, we\u0027d just adapt the specification to match the implementation.\nBut that\u0027s easier said than done, because the specification is 11 years\nold by now and reftables have already been implemented by JGit for a\nlong time. So if we now changed the specification, those libraries would\nhave to make a backwards-incompatible change.\n\nAnother alternative would be to bump the reftable format version, but\nthat feels suboptimal, too. Other libraries would all have to adapt, and\nit wouldn\u0027t really help us to fix the discrepancy between alternative\nimplementations and our implementation as older versions would still be\nmisinterpreted.\n\nThe only viable option seems to be that we simply treat this as a bug\nand fix it. This will of course make us misinterpret older reftables\nthat already exist on disk:\n\n  ┌───────┬───────────────┬─────────────────┬────────────┐\n  │ tz    │ HHMM encoding │ correct minutes │ divergence │\n  ├───────┼───────────────┼─────────────────┼────────────┤\n  │ +1400 │ 1400          │ 840             │ 560        │\n  ├───────┼───────────────┼─────────────────┼────────────┤\n  │ -1200 │ -1200         │ -720            │ 480        │\n  ├───────┼───────────────┼─────────────────┼────────────┤\n  │ +0530 │ 530           │ 330             │ 200        │\n  ├───────┼───────────────┼─────────────────┼────────────┤\n  │ +0000 │ 0             │ 0               │ 0          │\n  └───────┴───────────────┴─────────────────┴────────────┘\n\nBut this divergence ultimately doesn\u0027t matter much, as Git only uses the\ntimezone of reflog entries for display purposes anyway. We don\u0027t take\nthe timezone into account when parsing \"HEAD@{1.hour.ago}\" syntax, and\n`should_expire_reflog_ent()` doesn\u0027t use it either to decide whether\nreflog entries should be pruned.\n\nIn summary, the fallout from this change is quite contained. Adapt the\nreftable backend accordingly and simply reinterpret the timezones with\nthe specified meaning.\n\nAdd a test to verify that we properly encode the timezone as offset in\nminutes. Adapt the test helper accordingly to no longer zero-pad the\noffset with \"%04d\", as that can be easily misinterpreted as the \"HHMM\"\nencoding.\n\nReported-by: Josh McKinney \u003cgit-bugs@lists.joshka.net\u003e\nSigned-off-by: Patrick Steinhardt \u003cps@pks.im\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "10db03991e689a66bf8f871c13f3b1cdf039b88b",
      "old_mode": 33188,
      "old_path": "refs/reftable-backend.c",
      "new_id": "d0de0663552e0f8fb9b21b96f4f244baf3544502",
      "new_mode": 33188,
      "new_path": "refs/reftable-backend.c"
    },
    {
      "type": "modify",
      "old_id": "57758936b01b1eb365a1a2d26962a910a9086923",
      "old_mode": 33188,
      "old_path": "t/helper/test-reftable.c",
      "new_id": "d9f2ca1d0e4d9119958e9ae2715e2e8d7af2e321",
      "new_mode": 33188,
      "new_path": "t/helper/test-reftable.c"
    },
    {
      "type": "modify",
      "old_id": "35e98b43dba0358f5a230989baa0f122701aa696",
      "old_mode": 33261,
      "old_path": "t/t0610-reftable-basics.sh",
      "new_id": "2253705a19ce652e37b4ae1d5c9e3b77d33e17df",
      "new_mode": 33261,
      "new_path": "t/t0610-reftable-basics.sh"
    }
  ]
}
