Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Apr 14, 2010
  1. @trast @gitster

    diff: add --word-diff option that generalizes --color-words

    trast authored gitster committed
    This teaches the --color-words engine a more general interface that
    supports two new modes:
    * --word-diff=plain, inspired by the 'wdiff' utility (most similar to
      'wdiff -n <old> <new>'): uses delimiters [-removed-] and {+added+}
    * --word-diff=porcelain, which generates an ad-hoc machine readable
      - each diff unit is prefixed by [-+ ] and terminated by newline as
        in unified diff
      - newlines in the input are output as a line consisting only of a
        tilde '~'
    Both of these formats still support color if it is enabled, using it
    to highlight the differences.  --color-words becomes a synonym for
    --word-diff=color, which is the color-only format.  Also adds some
    compatibility/convenience options.
    Thanks to Junio C Hamano and Miles Bader for good ideas.
    Signed-off-by: Thomas Rast <>
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.