avp::ptr weblog

Everything that is in our mind.

Archive for the ‘lines’ tag

Coloring differences at a word-level using gitk

without comments

Due to their default behavior to handle differences on a line-by-line level most of the version control systems seem to be impractical when writing texts others than source code. Also git highlights changes to text files line-wise.

After some research I found some nice options to improve things.

Coloring words using git diff

git diff --color-words

Coloring words using gitk

gitk --word-diff=plain
gitk --word-diff=porcelain
gitk --word-diff=color

The gitk parameter option seems to be new and/or undocumented since I could neither find it on the man page of gitk nor I did get it with the auto-completion. Please find further interesting thoughts in the discussion of András Salamon on StackExchange and Eduardo’s post. Also Iain Murray’s cwdiff wrapper might be worth taking a closer look.

Gitk differences colored at line-level

Gitk differences colored at line-level

Gitk differences colored at word-level

Gitk differences colored at word-level

Written by tobi

August 14th, 2011 at 1:08 am