)]}'
{
  "commit": "be4908f1038861892878db29441be5a4a024784d",
  "tree": "5a82fd9a5459e357a9e9dafc6bfefc960d567625",
  "parents": [
    "d166e6afe5f257217836ef24a73764eba390c58d"
  ],
  "author": {
    "name": "Nguyễn Thái Ngọc Duy",
    "email": "pclouds@gmail.com",
    "time": "Tue Nov 13 18:52:26 2018 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Nov 14 15:02:24 2018 +0900"
  },
  "message": "checkout: disambiguate dwim tracking branches and local files\n\nWhen checkout dwim is added in [1], it is restricted to only dwim when\ncertain conditions are met and fall back to default checkout behavior\notherwise. It turns out falling back could be confusing. One of the\nconditions to turn\n\n    git checkout frotz\n\nto\n\n    git checkout -b frotz origin/frotz\n\nis that frotz must not exist as a file. But when the user comes to\nexpect \"git checkout frotz\" to create the branch \"frotz\" and there\nhappens to be a file named \"frotz\", git\u0027s silently reverting \"frotz\"\nfile content is not helping. This is reported in Git mailing list [2]\nand even used as an example of \"Git is bad\" elsewhere [3].\n\nWe normally try to do the right thing, but when there are multiple\n\"right things\" to do, it\u0027s best to leave it to the user to decide.\nCheck this case, ask the user to to disambiguate:\n\n- \"git checkout -- foo\" will check out path \"foo\"\n- \"git checkout foo --\" will dwim and create branch \"foo\" [4]\n\nFor users who do not want dwim, use --no-guess. It\u0027s useless in this\nparticular case because \"git checkout --no-guess foo --\" will just\nfail. But it could be used by scripts.\n\n[1] 70c9ac2f19 (DWIM \"git checkout frotz\" to \"git checkout -b frotz\n    origin/frotz\" - 2009-10-18)\n[2] https://public-inbox.org/git/CACsJy8B2TVr1g+k+eSQ\u003dpBEO3WN4_LtgLo9gpur8X7Z9GOFL_A@mail.gmail.com/\n[3] https://news.ycombinator.com/item?id\u003d18230655\n[4] a047fafc78 (checkout: allow dwim for branch creation for \"git\n    checkout $branch --\" - 2013-10-18)\n\nSigned-off-by: Nguyễn Thái Ngọc Duy \u003cpclouds@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "801de2f7645bf0b1fc506da58d469519abca8863",
      "old_mode": 33188,
      "old_path": "Documentation/git-checkout.txt",
      "new_id": "6acc3d98e7422be7f313b0a203a61565fae212c5",
      "new_mode": 33188,
      "new_path": "Documentation/git-checkout.txt"
    },
    {
      "type": "modify",
      "old_id": "acdafc6e4c4d104aadcbe7492a8045e16e83ba50",
      "old_mode": 33188,
      "old_path": "builtin/checkout.c",
      "new_id": "4744e8c0a72eae901308e5484a1c6f312e7278b9",
      "new_mode": 33188,
      "new_path": "builtin/checkout.c"
    },
    {
      "type": "modify",
      "old_id": "69b6774d10a9d90790316e9feb0f718593465c76",
      "old_mode": 33261,
      "old_path": "t/t2024-checkout-dwim.sh",
      "new_id": "fa0718c730c322bfe5f9e6642c4136a7533be5dc",
      "new_mode": 33261,
      "new_path": "t/t2024-checkout-dwim.sh"
    },
    {
      "type": "modify",
      "old_id": "175f83d7042a0fb9f093bc6f25e1d0b25ce548af",
      "old_mode": 33261,
      "old_path": "t/t9902-completion.sh",
      "new_id": "aa92f8523000ffe177aecb6477752de639d2e6d3",
      "new_mode": 33261,
      "new_path": "t/t9902-completion.sh"
    }
  ]
}
