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

[PATCH] Documentation/diff: give --word-diff-regex=. example

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 20, 2015, 13:36 UTC
Message-ID
<6697f80b679b2bc910aa02a0fc945453be38c532.1448026505.git.git@drmicha.warpmail.net>
In-Reply-To
<vpq1tbq812p.fsf@anie.imag.fr>
It's just so useful.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 Documentation/diff-options.txt | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index d56ca90..306b7e3 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -267,6 +267,9 @@ expression to make sure that it matches all non-whitespace characters.
 A match that contains a newline is silently truncated(!) at the
 newline.
 +
+For example, `--word-diff-regex=.` will treat each character as a word
+and, correspondingly, show differences character by character.
++
 The regex can also be set via a diff driver or configuration option, see
 linkgit:gitattributes[1] or linkgit:git-config[1].  Giving it explicitly
 overrides any diff driver or configuration setting.  Diff drivers
-- 
2.6.3.507.gca54332
Previous: Matthieu MoyNext: Matthieu Moy
Message 3 of 4 in “--color-diff='.' considered useful”
  1. Michael J GruberNov 16, 2015
  2. Matthieu MoyNov 16, 2015
  3. Documentation/diff: give --word-diff-regex=. exampleMichael J Gruber, Nov 20, 2015
  4. Matthieu MoyNov 20, 2015

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.