From: Johannes Sixt Date: Mon, 19 Mar 2012 09:58:19 GMT Subject: Re: A better git diff --word-diff (--word-diff-regex) ? Message-ID: <4F67033B.2060904@viscovery.net> In-Reply-To: Am 3/19/2012 10:44, schrieb Piotr Krukowiecki: > is there a way to configure --word-diff to be a more programming > language friendly? For example if I add one parameter to a function > declaration, I'd like to see only the addition of the parameter as the > change. But currently it shows much more. > > For example if > void foo(int x); > is changed to > void foo(int x, int y); > I'd like to see only ",int y" as the change, not "x, int y);". > > I think I'd like to ignore all white spaces and tokenize text on word > boundaries and see the diff between the tokens. This way if I e.g. add > a missing ";" it'll be shown as the only change. Start with git config diff.wordregex '[[:alnum:]]+|[^[:space:]]' Adjust to your likings. -- Hannes