2

In one project I am currently working on, there is a minified JS file which, for a variety of reasons, comes from a separate project. Because it is minified, however, it does not include newlines, which means that Git diff is rendered completely useless.

Is there a way to tell git diff to compare based on a different character (such as ;) instead of newline?

dbank
  • 1,173
  • 1
  • 17
  • 29
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
  • Yes, you can specify your own differ in the configs. Easiest would probably be a prettyprinter.preprocessor – jthill Mar 05 '15 at 03:04
  • http://stackoverflow.com/questions/3231759/how-can-i-visualize-per-character-differences-in-a-unified-diff-file – Milind Dumbare Mar 05 '15 at 08:32

1 Answers1

1

I'm not sure if this is exactly what you're after, but I'll give it a try since no one else has answered. You might try something like:

git diff --color-words=.

Then if desired you can apply a word wrap effect by typing -S (and press [ENTER]).

git diff's --word-diff-regex may also be of interest to you.

dbank
  • 1,173
  • 1
  • 17
  • 29