[PATCH v4 0/7] customizable --color-words
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jan 17, 2009, 16:29 UTC
- Message-ID
- <1232209788-10408-1-git-send-email-trast@student.ethz.ch>
- In-Reply-To
- <alpine.DEB.1.00.0901162208180.3586@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
> Thomas, could you pick up the patches from my 'my-next' branch and > maintain an "official" topic branch?
I cherry-picked the three commits you had there, and rebuilt on top. I pushed them to
git://repo.or.cz/git/trast.git tr/word-diff-p2
again (js/word-diff-p1 again points directly at your half).
The changes on your side since my last push (hence your last sent patches&squashes I collected) were only a pair of quotes changed from double to single.
On my side I mainly tweaked the TeX pattern since I noticed it didn't match many non-alnums such as (), and therefore declare them unchanged:
- "\\\\[a-zA-Z@]+|[][{}]|\\\\.|[a-zA-Z0-9\x80-\xff]+"),
+ "\\\\[a-zA-Z@]+|\\\\.|[a-zA-Z0-9\x80-\xff]+|[^[:space:]]"),I also added a clause to the C++ pattern to allow it to match declarations such as
int Foo::bar(...)
(it would give up on the :: before).
Johannes Schindelin (4):
Add color_fwrite_lines(), a function coloring each line individually
color-words: refactor word splitting and use ALLOC_GROW()
color-words: change algorithm to allow for 0-character word
boundaries
color-words: take an optional regular expression describing wordsThomas Rast (3): color-words: enable REG_NEWLINE to help user color-words: expand docs with precise semantics color-words: make regex configurable via attributes
Documentation/diff-options.txt | 17 +++- Documentation/gitattributes.txt | 21 ++++ color.c | 28 +++++ color.h | 1 + diff.c | 222 ++++++++++++++++++++++++++------------- diff.h | 1 + t/t4034-diff-words.sh | 159 ++++++++++++++++++++++++++++ userdiff.c | 78 +++++++++++--- userdiff.h | 1 + 9 files changed, 440 insertions(+), 88 deletions(-) create mode 100755 t/t4034-diff-words.sh