)]}'
{
  "commit": "c20f112e5149d1bd0d4741c4b28a65f81318309a",
  "tree": "68ab2d63f36af2854b3e49c563bd213fea1357a6",
  "parents": [
    "cb034c020aba54360e7c19faf82021399bf131e7"
  ],
  "author": {
    "name": "Christian Couder",
    "email": "christian.couder@gmail.com",
    "time": "Mon Nov 17 05:34:50 2025 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Nov 26 08:43:44 2025 -0800"
  },
  "message": "fast-import: add \u0027strip-if-invalid\u0027 mode to --signed-commits\u003d\u003cmode\u003e\n\nTools like `git filter-repo`[1] use `git fast-export` and\n`git fast-import` to rewrite repository history. When rewriting\nhistory using one such tool though, commit signatures might become\ninvalid because the commits they sign changed due to the changes\nin the repository history made by the tool between the fast-export\nand the fast-import steps.\n\nNote that as far as signature handling goes:\n\n  * Since fast-export doesn\u0027t know what changes filter-repo may make\nto the stream, it can\u0027t know whether the signatures will still be\nvalid.\n\n  * Since filter-repo doesn\u0027t know what history canonicalizations\nfast-export performed (and it performs a few), it can\u0027t know whether\nthe signatures will still be valid.\n\n  * Therefore, fast-import is the only process in the pipeline that\ncan know whether a specified signature remains valid.\n\nHaving invalid signatures in a rewritten repository could be\nconfusing, so users rewritting history might prefer to simply\ndiscard signatures that are invalid at the fast-import step.\n\nFor example a common use case is to rewrite only \"recent\" history.\nWhile specifying commit ranges corresponding to \"recent\" commits\ncould work, users worry about getting it wrong and want to just\nautomatically rewrite everything, expecting older commit signatures\nto be untouched.\n\nTo let them do that, let\u0027s add a new \u0027strip-if-invalid\u0027 mode to the\n`--signed-commits\u003d\u003cmode\u003e` option of `git fast-import`.\n\nIt would be interesting for the `--signed-tags\u003d\u003cmode\u003e` option to\nhave this mode too, but we leave that for a future improvement.\n\nIt might also be possible for `git fast-export` to have such a mode\nin its `--signed-commits\u003d\u003cmode\u003e` and `--signed-tags\u003d\u003cmode\u003e`\noptions, but the use cases for it are much less clear, so we also\nleave that for possible future improvements.\n\nFor now let\u0027s just die() if \u0027strip-if-invalid\u0027 is passed to these\noptions where it hasn\u0027t been implemented yet.\n\n[1]: https://github.com/newren/git-filter-repo\n\nHelped-by: Elijah Newren \u003cnewren@gmail.com\u003e\nSigned-off-by: Christian Couder \u003cchriscool@tuxfamily.org\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b74179a6c891d5ad72ef34b89e47de8cdf53b100",
      "old_mode": 33188,
      "old_path": "Documentation/git-fast-import.adoc",
      "new_id": "479c4081da8f27429d933d6e6d214ab0300b5682",
      "new_mode": 33188,
      "new_path": "Documentation/git-fast-import.adoc"
    },
    {
      "type": "modify",
      "old_id": "7adbc55f0dccb1878071aeb8af45f9b39ce3bf4c",
      "old_mode": 33188,
      "old_path": "builtin/fast-export.c",
      "new_id": "a839a8f9acefde92b21679e57933ef42b4b4765c",
      "new_mode": 33188,
      "new_path": "builtin/fast-export.c"
    },
    {
      "type": "modify",
      "old_id": "493de57ef67bfb4f6426290b3fe1f750a0738e9c",
      "old_mode": 33188,
      "old_path": "builtin/fast-import.c",
      "new_id": "e2c6894461044b60a8ced860d8c866c841f63988",
      "new_mode": 33188,
      "new_path": "builtin/fast-import.c"
    },
    {
      "type": "modify",
      "old_id": "d1e88da8c1bfde442663b13409b02f06538a639e",
      "old_mode": 33188,
      "old_path": "gpg-interface.c",
      "new_id": "fe653b246433b8d283d86f70307ea01121d65177",
      "new_mode": 33188,
      "new_path": "gpg-interface.c"
    },
    {
      "type": "modify",
      "old_id": "50487aa14832743e2d294893319c3bfa70332448",
      "old_mode": 33188,
      "old_path": "gpg-interface.h",
      "new_id": "71dde8cb8074373894c159163e8e742a22cb8415",
      "new_mode": 33188,
      "new_path": "gpg-interface.h"
    },
    {
      "type": "modify",
      "old_id": "c2b427165862d3cf68fc7facd53fadc93e16ad43",
      "old_mode": 33261,
      "old_path": "t/t9305-fast-import-signatures.sh",
      "new_id": "022dae02e48177e4c09f243c0b0b6f06ab8aa147",
      "new_mode": 33261,
      "new_path": "t/t9305-fast-import-signatures.sh"
    }
  ]
}
