3 ms·
OT The new diff script (https://github.com/git/git/blob/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/blob/master/contrib/diff-highli
by hkjgkjy 10y ago
OT
The new diff script (https://github.com/git/git/blob/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/blob/master/contrib/diff-highligh...) is juicy indeed.
It is written in Perl. The Perl interpreter is available on most UNIX systems, so that's handy. I wonder if there is any Lisp-like language that is as common, that you can write scripts and expect them to run on most systems. Would be nice since Lisp languages have very few concepts to learn...
- tveita 10y agoGuile may be the closest, but it failed to gain much traction despite support in some popular GNU tools like GDB. It's certainly not installed on most systems, but it at least has a tiny chance of being present.
- creshal 10y agoOn Arch Linux it's a dependency of both gdb and make, but it seems that other distributions go out of their way to avoid shipping it (Debian e.g. builds gdb without a hard dependency on it, and you need to install a separate make-guile package to get guile-enabled make).
- s_kilk 10y agoIs guile part of the default packages on any unix-alike distribution though? The huge upside of perl is not necessarily that it's available, but that it's available by default.
- baldfat 10y agoI second the ability to use a Lisp language for this also (Racket Please).
- peff 10y agoI hope to one day push the highlighting inside of git itself. That should make it more efficient, and we can do a true LCS diff to find the common parts, rather than the front/back heuristic it currently does (see the diff-highlight README for the gory details). It's just a little complicated because of the way it interacts with existing internal diff features (in particular the whitespace-error highlighting).
- chronial 10y agoEven more OT, but: This script is not new at all: https://github.com/git/git/commits/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/commits/master/contrib/diff-highl...