Tig: color-words support

Created on 30 Apr 2012  路  17Comments  路  Source: jonas/tig

Currently, tig has no support for color-words in diffs. In fact, starting tig wit the --color-words option fails with "No revisions match the given argument" (which is quite misleading as error message).

This should probably be consiered a long-term TODO, as it requires some heavy-duty re-engineering of the diff view, especially with respect to highlighting. Also, color-word support would require massaging the input parameters, since the word-diff option should always be turned into 'porcelain'.

diff

Most helpful comment

+1

All 17 comments

While looking at issue #26, I have been looking into adding support for --word-diff=porcelain as a way to provide side-by-side diff support. AFAIK, the parsing of the word diff can be shared, but will require different rendering methods. So yeah, I agree that it will require some work to get proper highlighting. For example, the line->data member will probably have to become a struct of line boxes on which we can attach color and length information. Since the diff view shares a lot of code with the pager and stage view it probably makes sense to also use this line box struct for all the current 'pager-based' views.

+1 --color-words

Yes, great goal!

Would also be great if this supported --word-regex as well. It's sometimes nice to do a character diff. This would be a handy toggle setting too.

Line Diff -> Word Diff -> Character Diff

Okay, I got ahead of myself. After learning a bit more. Porcelain support looks like it would be great. Github seems to have this dialed in, so hopefully using something like they do would be helpful :)

Support for word-diff would be just awesome!

+1 for this feature. In the meantime I helped myself with an external command to have easy access to the output from within tig.

status= W !git diff --color-words --cached %(file)

+1 --color-words

+1, this would make diffs much easier!

+1

+1

+1

Any news on this? It's been open for more than four years now ;-)

+1

attempted exporting TIG_DIFF_OPTS=--color-words but no luck, seems inline color escapes are not supported?

+1

+1 very useful. Why one should leave tig to get colored diff (with options)?

+1 for this feature

I've just discovered tig but without --color-words it's much less valuable for me than it would be with it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

achikin picture achikin  路  7Comments

kiryph picture kiryph  路  6Comments

dmalikov picture dmalikov  路  4Comments

proski picture proski  路  3Comments

danielb2 picture danielb2  路  3Comments