{"action":"created","issue":{"url":"https://api.github.com/repos/progit/progit2/issues/607","repository_url":"https://api.github.com/repos/progit/progit2","labels_url":"https://api.github.com/repos/progit/progit2/issues/607/labels{/name}","comments_url":"https://api.github.com/repos/progit/progit2/issues/607/comments","events_url":"https://api.github.com/repos/progit/progit2/issues/607/events","html_url":"https://github.com/progit/progit2/pull/607","id":151403515,"number":607,"title":"(Book) Restores missing step in objects.asc","user":{"login":"flyingzumwalt","id":138930,"avatar_url":"https://avatars.githubusercontent.com/u/138930?v=3","gravatar_id":"","url":"https://api.github.com/users/flyingzumwalt","html_url":"https://github.com/flyingzumwalt","followers_url":"https://api.github.com/users/flyingzumwalt/followers","following_url":"https://api.github.com/users/flyingzumwalt/following{/other_user}","gists_url":"https://api.github.com/users/flyingzumwalt/gists{/gist_id}","starred_url":"https://api.github.com/users/flyingzumwalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyingzumwalt/subscriptions","organizations_url":"https://api.github.com/users/flyingzumwalt/orgs","repos_url":"https://api.github.com/users/flyingzumwalt/repos","events_url":"https://api.github.com/users/flyingzumwalt/events{/privacy}","received_events_url":"https://api.github.com/users/flyingzumwalt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-27T14:42:15Z","updated_at":"2016-04-28T02:17:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/progit/progit2/pulls/607","html_url":"https://github.com/progit/progit2/pull/607","diff_url":"https://github.com/progit/progit2/pull/607.diff","patch_url":"https://github.com/progit/progit2/pull/607.patch"},"body":"Restores missing step: update cache to point to \"new\" test.txt (`1f7a7a472abf3dd9643fd615f6da379c4acb3e3a`) when building the tree `0155eb4229851634a0f03eb265b69f5a2d56f341`\r\n\r\n## Explanation\r\n\r\nWhen building the tree whose SHA1 will be `0155eb4`, the text says _\"You’ll now create a new tree with the second version of test.txt and a new file as well\"_, but it never updates the index to point to the second version of test.txt, which means that when you run `git write-tree` in the next step you don't get `0155eb4229851634a0f03eb265b69f5a2d56f341` as the SHA.\r\n\r\nThis patch adds a step to the instructions that updates the index to point to that second version of test.txt. When you include this step, you get the right SHA.\r\n"},"comment":{"url":"https://api.github.com/repos/progit/progit2/issues/comments/215288694","html_url":"https://github.com/progit/progit2/pull/607#issuecomment-215288694","issue_url":"https://api.github.com/repos/progit/progit2/issues/607","id":215288694,"user":{"login":"YueLinHo","id":5831804,"avatar_url":"https://avatars.githubusercontent.com/u/5831804?v=3","gravatar_id":"","url":"https://api.github.com/users/YueLinHo","html_url":"https://github.com/YueLinHo","followers_url":"https://api.github.com/users/YueLinHo/followers","following_url":"https://api.github.com/users/YueLinHo/following{/other_user}","gists_url":"https://api.github.com/users/YueLinHo/gists{/gist_id}","starred_url":"https://api.github.com/users/YueLinHo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YueLinHo/subscriptions","organizations_url":"https://api.github.com/users/YueLinHo/orgs","repos_url":"https://api.github.com/users/YueLinHo/repos","events_url":"https://api.github.com/users/YueLinHo/events{/privacy}","received_events_url":"https://api.github.com/users/YueLinHo/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T02:17:36Z","updated_at":"2016-04-28T02:17:36Z","body":"Locate the section of web page: [10.2 Git Internals - Git Objects - Tree Objects](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects#Tree-Objects)\r\n\r\nI've go through the example. I don't think it is needed, because of the second version of file `test.txt` IS in the directory. \r\n\r\nThe earier example does it:\r\n```\r\n$ git cat-file -p 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a > test.txt\r\n$ cat test.txt\r\nversion 2\r\n``` \r\nand it's also in staging area by previous command:\r\n```\r\n$ git update-index --add --cacheinfo 100644 \\\r\n  83baae61804e65cc73a7201a7252750c76066a30 test.txt\r\n```\r\n\r\nThat's why you just see the command without `--add` and `--cacheinfo` (the second line in that example):\r\n```\r\n$ git update-index test.txt\r\n```\r\n\r\nI just created a new related issue #608.\r\nYou can re-roll this PR if @ben agree the statement in that issue.\r\nIf he does, I'd like to give a further suggestion which changing the title to \r\n```\r\nFixed issue #608: Make clear why using `--cacheinfo` of `git update-index`\r\n```"}}