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

[PATCH v3 0/4] customizable --color-words

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 11, 2009, 10:27 UTC
Message-ID
<cover.1231669012.git.trast@student.ethz.ch>
In-Reply-To
<7vr63atykr.fsf@gitster.siamese.dyndns.org>
Johannes Schindelin wrote:
> On Sat, 10 Jan 2009, Thomas Rast wrote:
> > Johannes Schindelin wrote:
> > > So I still find your patch way too large
The bad news is... it just got bigger ;-)
Show 6 quoted lines
> In your case, I imagine it would be much easier to get reviewers if you 
> had
> 
> 	patch 1/4 refactor color-words to allow for 0-character word 
> 		boundaries
> 	patch 2/4 allow regular expressions to define what makes a word

So here's a 4-patch series. I put the first split in a different place than you suggested, however. I couldn't see a good way to separate empty boundaries from regex splitting in such a way that the first half can be exercised (is not just dead code). 1/4 basically just rearranges code a bit and should be a real no-op patch.

Junio C Hamano wrote:
>     diff.c: In function 'scan_word_boundaries':
>     diff.c:512: warning: enumeration value 'DIFF_WORD_UNDEF' not handled in sw
Thanks, added a case to test for this.

There is one other minor semantic change in 2/4: the error reporting in case your regex matched "foo\nbar" now says "before 'bar'" instead of "near '\nbar'". Other than that, there are only a bunch of added comments when comparing the result of all four patches with v2.

Thomas Rast (4):
  word diff: comments, preparations for regex customization
  word diff: customizable word splits
  word diff: make regex configurable via attributes
  word diff: test customizable word splits
 Documentation/diff-options.txt  |   18 +++-
 Documentation/gitattributes.txt |   21 +++
 diff.c                          |  282 ++++++++++++++++++++++++++++++++++++---
 diff.h                          |    1 +
 t/t4033-diff-color-words.sh     |   90 +++++++++++++
 userdiff.c                      |   27 +++-
 userdiff.h                      |    1 +
 7 files changed, 413 insertions(+), 27 deletions(-)
 create mode 100755 t/t4033-diff-color-words.sh
Previous: Junio C HamanoNext: Thomas Rast
Message 22 of 34 in “make diff --color-words customizable”
  1. make diff --color-words customizableThomas Rast, Jan 9, 2009
  2. Johannes SchindelinJan 9, 2009
  3. Thomas RastJan 9, 2009
  4. Johannes SchindelinJan 9, 2009
  5. color-words: take an optional regular expression describing wordsJohannes Schindelin, Jan 9, 2009
  6. Thomas RastJan 9, 2009
  7. Teemu LikonenJan 9, 2009
  8. make diff --color-words customizableThomas Rast, Jan 10, 2009
  9. Jakub NarebskiJan 10, 2009
  10. Johannes SchindelinJan 10, 2009
  11. Jakub NarebskiJan 10, 2009
  12. Johannes SchindelinJan 10, 2009
  13. Jakub NarebskiJan 12, 2009
  14. Johannes SchindelinJan 13, 2009
  15. Davide LibenziJan 10, 2009
  16. Jakub NarebskiJan 13, 2009
  17. Davide LibenziJan 13, 2009
  18. Johannes SchindelinJan 10, 2009
  19. Thomas RastJan 10, 2009
  20. Johannes SchindelinJan 10, 2009
  21. Junio C HamanoJan 11, 2009
  22. 0/4 customizable --color-wordsThomas Rast, Jan 11, 2009
  23. 1/4 word diff: comments, preparations for regex customizationThomas Rast, Jan 11, 2009
  24. 2/4 word diff: customizable word splitsThomas Rast, Jan 11, 2009
  25. 3/4 word diff: make regex configurable via attributesThomas Rast, Jan 11, 2009
  26. 4/4 word diff: test customizable word splitsThomas Rast, Jan 11, 2009
  27. Junio C HamanoJan 11, 2009
  28. Junio C HamanoJan 11, 2009
  29. Johannes SchindelinJan 11, 2009
  30. Johannes SchindelinJan 11, 2009
  31. Junio C HamanoJan 11, 2009
  32. Jeff KingJan 9, 2009
  33. Johannes SchindelinJan 9, 2009
  34. Jeff KingJan 9, 2009

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.