{"thread":{"id":"52822","subject":"git diff from a pre-commit hook","startedAt":"2020-02-17T09:01:17Z","lastAt":"2020-02-17T09:01:17Z","messageCount":1,"participants":["Michael Strelnikov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"391912","messageId":"CANno94g7S68OfXNJ5B-uKR5=oZn3dsuDsuZHnKrh7tXzYWPNig@mail.gmail.com","threadId":"52822","inReplyTo":null,"subject":"git diff from a pre-commit hook","fromName":"Michael Strelnikov","fromEmail":"michaelst@gmail.com","sentAt":"2020-02-17T09:00:38Z","receivedAt":"2020-02-17T09:01:17Z","isPatch":false,"sender":{"key":"michaelst@gmail.com","avatar":null},"body":"Hello,\n\n   I'm trying to implement the pre-commit hook and faced a problem.\n   1. If I just run command \"git diff --staged --name-only\n--diff-filter=A\" I get an error: \"fatal: unable to read [SHA]\"\n   2. After searching for solutions I found that for a pre-commit hook\nI have to re-set the GIT_INDEX_FILE variable to \".git/index\". After\ndoing that I see that diff is not honoring the \"info/exclude\"\nsettings.\n\nIs there anything else I need to set to make diff working properly?\n\nBest regards,\nMichael Strelnikov\n"}]}