)]}'
{
  "commit": "45d197a469f9ebeda91e7fd4fd522bb558e88bca",
  "tree": "530289ed5c283a41d6596cc13f0cee35e7f4c336",
  "parents": [
    "f5e375c9a99d731c05eef701f119da85d62fc158"
  ],
  "author": {
    "name": "Junio C Hamano",
    "email": "junkio@cox.net",
    "time": "Mon Aug 22 17:55:26 2005 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "junkio@cox.net",
    "time": "Mon Aug 22 23:19:18 2005 -0700"
  },
  "message": "Introduce \"reset type\" flag to \"git reset\"\n\nI have been feeling that the current behaviour of \"git reset\" is\nnot quite optimal, but so far could not express exactly what I\nfelt was wrong with it.  This patch clarifies it.\n\nThere are at least two situations you may want to \"reset\" your\nworking tree.\n\n1. You made a mess in your working tree.  You want to switch\n   back to a known good state and start over.  This mess may be\n   a result of your own editing, a merge that had too many\n   conflicting changes that you do not feel like to resolve by\n   hand at this moment, or a botched application of a patch you\n   received from somewhere.\n\n   In this case, you would want to have \"git reset HEAD\" reset\n   the index file to the tree read from the HEAD commit and the\n   files in the working tree to match index (i.e. \"git status\"\n   should say \"Nothing to commit\", without any \"unrecorded\n   changes\").\n\n   The current behaviour leaves the files in the working tree\n   intact, which requires you to run \"git checkout -f\".  Also\n   you need to remember \"rm -f\" any files that the botched patch\n   may have left in the working tree if the purpose of this\n   \"reset\" is to attempt to apply it again; most likely the\n   patch would fail if such a file is left behind.\n\n2. You have discovered that commits you made earlier need to be\n   reorganized.  The simplest example is to undo the last\n   commit, re-edit some files, and redo the commit.  Another\n   simple eample is to undo the last two commits, and commit the\n   changes in those two commits as a single commit.\n\n   In this case, you would want to have \"git reset HEAD^\" reset\n   the $GIT_DIR/HEAD to the commit object name of the parent\n   commit of the current commit (i.e. rewinding one commit),\n   leave the index file and the files in the working tree in a\n   state where you can easily make a commit that records a tree\n   that resembles what you have in the current index file and\n   the working tree.\n\n   The current behaviour is almost OK for this purpose, except\n   that you need to find which files you need to manually run\n   \"git add\" yourself.  They are files that are in the original\n   HEAD commit and not in the commit you are resetting to.\n\nThe default without the type flag is to do \"--mixed\", which is\nthe current behaviour.\n\n    $ git reset [ --hard | --soft | --mixed ] [ \u003ccommit-ish\u003e ]\n\nA hard reset would be used for 1 and works in this way:\n\n    (1) remember the set of paths that appear in the current\n        index file (which may even have unmerged entries) and\n\tthe current $GIT_DIR/HEAD commit.\n\n    (2) \"read-tree --reset\" the specified \u003ccommit-ish\u003e (default\n        to HEAD), followed by \"checkout-cache -f -u -a\".\n\n    (3) remove any files that appear in (1) but not in\n        \u003ccommit-ish\u003e from the working tree.\n\n    (4) backup $GIT_DIR/HEAD to $GIT_DIR/ORIG_HEAD and update\n        $GIT_DIR/HEAD with the specified \u003ccommit-ish\u003e.\n\n    (5) remove leftover $GIT_DIR/MERGE_HEAD\n\nA soft reset would be used for 2 and works in this way:\n\n    (1) Make sure that the index file is merged and we do not\n        have MERGE_HEAD; otherwise it does not make sense to do\n        soft reset.\n\n    (2) backup $GIT_DIR/HEAD to $GIT_DIR/ORIG_HEAD and update\n        $GIT_DIR/HEAD with the specified \u003ccommit-ish\u003e.\n\nNote that with the current behaviour, \"git diff\" is the way to\nsee what could be committed immediately after \"git reset\".  With\nthe \"soft reset\" described here you would need to say \"git diff\nHEAD\" to find that out.\n\nI am not sure what mixed reset (the current behaviour) is good\nfor.  If nobody comes up with a good use case it may not be a\nbad idea to remove it.\n\nSigned-off-by: Junio C Hamano \u003cjunkio@cox.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7da8d86823b09a6fa9a5c5d28dcc849253843181",
      "old_mode": 33261,
      "old_path": "git-reset-script",
      "new_id": "863e2a997ebcdba515af6a7af421235f56b81cc9",
      "new_mode": 33261,
      "new_path": "git-reset-script"
    }
  ]
}
