{"thread":{"id":"62087","subject":"[bug?] git diff --cached in a non-git directory","startedAt":"2024-09-09T14:48:38Z","lastAt":"2024-09-09T14:48:38Z","messageCount":1,"participants":["Okke Timm"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"502452","messageId":"92DCB50E-A2F6-4334-A0C5-A9CB2D29AC18@timm.sh","threadId":"62087","inReplyTo":null,"subject":"[bug?] git diff --cached in a non-git directory","fromName":"Okke Timm","fromEmail":"okke@timm.sh","sentAt":"2024-09-09T14:48:26Z","receivedAt":"2024-09-09T14:48:38Z","isPatch":false,"sender":{"key":"okke@timm.sh","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nI changed into a non-git directory.\nThen I called git with 'git diff --cached', which produced this error:\n\nerror: unknown option `cached'\nusage: git diff --no-index [<options>] <path> <path>\n[...]\n\nWhat did you expect to happen? (Expected behavior)\nA helfpul error message.\n\nWhat happened instead? (Actual behavior)\nAn unhelpful error message saying that cached is an unknown option.\n\nWhat's different between what you expected and what actually happened?\nMe being confused why git suddenly forgot that `git diff --cached` is an allowed option.\n\nAnything else you want to add:\nPlease fix and thank you for this great tool!\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.46.0\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.4.0\nzlib: 1.2.12\nuname: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:21 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8103 arm64\ncompiler info: clang: 15.0.0 (clang-1500.3.9.4)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /opt/homebrew/bin/bash\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n\n"}]}