git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: A better git diff --word-diff (--word-diff-regex) ?

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
Mar 19, 2012, 17:06 UTC
Message-ID
<CAA01Cso5z9oT_MyFmGCJ0aV7EXb11k8zK4bJ9XBBLT3Yx_zpdw@mail.gmail.com>
In-Reply-To
<87ipi0vs0q.fsf@thomas.inf.ethz.ch>
On Mon, Mar 19, 2012 at 10:50 AM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 13 quoted lines
> Piotr Krukowiecki <piotr.krukowiecki@gmail.com> writes:
>
>> 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.
>
> Umm, what's wrong with
>
>  echo '*.cpp diff=cpp' >>.git/info/attributes
>
> Ok, the funcname patterns aren't so good, but the word regex is designed
> to "tokenize" as far as that is feasible.
Thanks, that's very good! I've missed it reading the git-diff man page.
-- 
Piotr Krukowiecki
Previous: Thomas RastNext: Johannes Sixt
Message 5 of 7 in “A better git diff --word-diff (--word-diff-regex) ?”
  1. Piotr KrukowieckiMar 19, 2012
  2. Matthieu MoyMar 19, 2012
  3. Piotr KrukowieckiMar 19, 2012
  4. Thomas RastMar 19, 2012
  5. Piotr KrukowieckiMar 19, 2012
  6. Johannes SixtMar 19, 2012
  7. Jeff KingMar 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.