{"thread":{"id":"28787","subject":"Unused (assigned but not read) option in diff_no_index","startedAt":"2011-10-28T15:08:24Z","lastAt":"2011-10-28T15:08:24Z","messageCount":1,"participants":["Piotr Krukowiecki"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178468","messageId":"CAA01Csruo+PPbgWMjTdkOeCEVx_Hgr=_tN-pTOiWxRfCd3nbyQ@mail.gmail.com","threadId":"28787","inReplyTo":null,"subject":"Unused (assigned but not read) option in diff_no_index","fromName":"Piotr Krukowiecki","fromEmail":"piotr.krukowiecki@gmail.com","sentAt":"2011-10-28T15:08:24Z","receivedAt":"2011-10-28T15:08:24Z","isPatch":false,"sender":{"key":"piotr.krukowiecki@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3259959?v=4"},"body":"Hi,\n\nI noticed that \"options\" variable in diff-no-index.c:diff_no_index()\nis modified when \"-q\" is passed but not used (not read) at all. So\neither it can be removed or it should be used. \"-q\" is not described\nin git-diff man page.\n\nThis code was introduced in 0569e9b8 \"git diff\": do not ignore index\nwithout --no-index\" - it was moved from builtin-diff.c (where it was\nused) but the code was refactored so I can't say if it should still\nbe.\n\n$ grep -E -2 '\\boptions\\b' diff-no-index.c\n\tint i;\n\tint no_index = 0;\n\tunsigned options = 0;\n\n\t/* Were we asked to do --no-index explicitly? */\n--\n\t\t\ti++;\n\t\telse if (!strcmp(argv[i], \"-q\")) {\n\t\t\toptions |= DIFF_SILENT_ON_REMOVED;\n\t\t\ti++;\n\t\t}\n\n-- \nPiotr Krukowiecki\n"}]}