{"thread":{"id":"55296","subject":"git difftool -I and git diff -I behave differently","startedAt":"2021-03-11T20:20:07Z","lastAt":"2021-03-11T20:20:07Z","messageCount":1,"participants":["Mustafa Zengin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"418903","messageId":"CAJ-1jP7fy95V5ROj0gE3UC9zn5f=8pTTGy1Y7cwQtx7DidEhqw@mail.gmail.com","threadId":"55296","inReplyTo":null,"subject":"git difftool -I and git diff -I behave differently","fromName":"Mustafa Zengin","fromEmail":"mzengin88@gmail.com","sentAt":"2021-03-11T20:18:50Z","receivedAt":"2021-03-11T20:20:07Z","isPatch":false,"sender":{"key":"mzengin88@gmail.com","avatar":null},"body":"Hi,\n\ngit difftool and git diff behave differently for option -I.\n\nRepro steps:\n1. Add a line with \"text\" into a file (without the quotes)\n2. Run\n  git diff -I\"text\"\n3. Observe that no output is returned\n4. Run\n  git difftool -I\"text\"\n5. Observe that the assigned diff tool is opened with the change\nincluding \"text\".\n\nExpected:\nIn step 5, no diff is shown.\n\nMy expectation is based on three things:\n1. -S and -G options behave the same for `git diff` and `git difftool`.\n2. Quote from https://git-scm.com/docs/git-difftool\n    \"See git-diff[1] for the full list of supported options.\"\n   It implies that all `git diff` options are inherited to `git difftool`.\n3. It looks like the command is attempting to parse the option so it\nis not completely ignored. If I make the regex malformed, e.g.\n     git difftool -I\"*text\"\n   I get back:\n     error: invalid regex given to -I: '*text'\n\nStackOverflow post:\nhttps://stackoverflow.com/questions/66574689/git-difftool-with-i-option\n\nVersions tested:\nWindows: git version 2.30.0.windows.1\nUbuntu: git version 2.30.2\n\nThanks,\nMustafa\n"}]}