{"thread":{"id":"58329","subject":"git diff --functional-changes ?","startedAt":"2022-08-19T16:46:28Z","lastAt":"2022-08-22T15:54:10Z","messageCount":2,"participants":["Christian Heller","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"461579","messageId":"CAOu2uD_CaVxxEtZhe4197ERDFASckUBtK_NyhmwQXr=5_reSXw@mail.gmail.com","threadId":"58329","inReplyTo":null,"subject":"git diff --functional-changes ?","fromName":"Christian Heller","fromEmail":"christian.heller63@gmail.com","sentAt":"2022-08-19T16:10:43Z","receivedAt":"2022-08-19T16:46:28Z","isPatch":false,"sender":{"key":"christian.heller63@gmail.com","avatar":null},"body":"Feature request\n\nI recently ran GNU indent on a larger C project which made all diffs\nhorribly noisy.\nIs there an option for git diff to ignore changes due to the placement\nof curly braces '{', '}' ?\nEqually helpful would be an option to ignore changes to comments.\n\nSomething like:\n- delete all comments\n- re-normalize line-breaks and indentation\n- show only 'functional' changes\n\nRegards,\nChris\n"},{"id":"461769","messageId":"5s05s44n-6q71-1198-8or9-164637q1sqp4@tzk.qr","threadId":"58329","inReplyTo":"CAOu2uD_CaVxxEtZhe4197ERDFASckUBtK_NyhmwQXr=5_reSXw@mail.gmail.com","subject":"Re: git diff --functional-changes ?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-08-22T15:53:49Z","receivedAt":"2022-08-22T15:54:10Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Christian,\n\nOn Fri, 19 Aug 2022, Christian Heller wrote:\n\n> Feature request\n>\n> I recently ran GNU indent on a larger C project which made all diffs\n> horribly noisy.\n> Is there an option for git diff to ignore changes due to the placement\n> of curly braces '{', '}' ?\n> Equally helpful would be an option to ignore changes to comments.\n>\n> Something like:\n> - delete all comments\n> - re-normalize line-breaks and indentation\n> - show only 'functional' changes\n\nThis would be very language-specific, and if you find a utility that can\ndo that, you will want to use it in Git via the external diff extension\nmechanism:\nhttps://git-scm.com/docs/git-diff#Documentation/git-diff.txt---ext-diff\n\nAs far as pure Git goes, I have had luck using the\n[--ignore-space-change][space-change] and the [--word-diff][word-diff]\noptions.\n\nTo be honest, I use a custom word diff quite often:\n`--word-diff=[A-Za-z0-9_]+|.`. This marks stretches of\nalpha-numeric-plus-underscore characters as words, and treats all other\ncharacters as single-character words, too (which means that it also colors\nparentheses and such).\n\nMaybe these help you, even if they do not solve precisely for what you\nasked.\n\nCiao,\nJohannes\n\n[space-change]: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---ignore-space-change\n[word-diff]: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---word-diffltmodegt\n"}]}