)]}'
{
  "commit": "4970bedef2e077f78baac5c6e825d17786be735b",
  "tree": "da5e442f341eed31aa45a152b71c2e3598add47f",
  "parents": [
    "aa9166bcc0ba654fc21f198a30647ec087f733ed"
  ],
  "author": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jul 21 14:53:12 2023 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jul 21 15:30:57 2023 -0700"
  },
  "message": "branch: update the message to refuse touching a branch in-use\n\nThe \"git branch -f\" command can refuse to force-update a branch that\nis used by another worktree.  The original rationale for this\nbehaviour was that updating a branch that is checked out in another\nworktree, without making a matching change to the index and the\nworking tree files in that worktree, will lead to a very confused\nuser.  \"git diff HEAD\" will no longer give a useful patch, because\nHEAD is a commit unrelated to what the index and the working tree in\nthe worktree were based on, for example.\n\nThese days, the same mechanism also protects branches that are being\nrebased or bisected, and the same machanism is expected to be the\nright place to add more checks, when we decide to protect branches\nundergoing other kinds of operations.  We however forgot to rethink\nthe messaging, which originally said that we are refusing to touch\nthe branch because it is \"checked out\" elsewhere, when d2ba271a\n(branch: check for bisects and rebases, 2022-06-14) started to\nprotect branches that are being rebased or bisected.\n\nThe spirit of the check has always been that we do not want to\ndisrupt the use of the same branch in other worktrees.  Let\u0027s reword\nthe message slightly to say that the branch is \"used by\" another\nworktree, instead of \"checked out\".\n\nWe could teach the branch.c:prepare_checked_out_branches() function\nto remember why it decided that a particular branch needs protecting\n(i.e. was it because it was checked out?  being bisected?  something\nelse?) in addition to which worktree the branch was in use, and use\nthat in the error message to say \"you cannot force update this\nbranch because it is being bisected in the worktree X\", etc., but it\nis dubious that such extra complexity is worth it.  The message\nalready tells which directory the worktree in question is, and it\nshould be just a \"chdir\" away for the user to find out what state it\nis in, if the user felt curious enough.  So let\u0027s not go there yet.\n\nHelped-by: Josh Sref \u003cjsoref@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cdf70b0ef0706eb328902ea21049ab57eaa675a3",
      "old_mode": 33188,
      "old_path": "branch.c",
      "new_id": "3e4684f79f693059a6272465dd983e149aee5eb9",
      "new_mode": 33188,
      "new_path": "branch.c"
    },
    {
      "type": "modify",
      "old_id": "019a40df2ca99480c547910026bf97102d54a23c",
      "old_mode": 33261,
      "old_path": "t/t2407-worktree-heads.sh",
      "new_id": "469443d8ae8c44483c7dbea8dd3c3fc2baef0745",
      "new_mode": 33261,
      "new_path": "t/t2407-worktree-heads.sh"
    }
  ]
}
