Rift Star on GitHubv0.3.0

Rift / Use cases

git diff says "Binary files differ" for a large file

The file is plain text. Git still refuses to show a diff once it passes 512 MiB.

rift git-diff ships in 0.3.0.

Git decides a file is binary when it is larger than 512 MiB. It prints one line and no diff. This is a 640 MiB pair of generated SQL dumps:

git diff on a large text file
$ git diff --no-index a.sql b.sql
diff --git a/a.sql b/b.sql
index 86d4681..61a1efd 100644
Binary files a/a.sql and b/b.sql differ

The fix

Tell git to run Rift for the large files:

echo '*.sql diff=rift' >> .gitattributes
git config diff.rift.command 'rift git-diff --mem 1G'

The same command on the same pair, with Rift as the external diff:

git diff with rift git-diff
$ git -c diff.external='rift git-diff' diff --no-index a.sql b.sql > out.diff
$ head -n 12 out.diff | cut -c1-100
diff --git a/a.sql b/b.sql
index 86d4681..61a1efd 100644
--- a/a.sql
+++ b/b.sql
@@ -380,7 +380,6 @@
 INSERT INTO public.orders (id, customer_id, status, amount, note) VALUES (380, 514366, 'shipped', 5
 381	178722	cancelled	2930.54	wmojdqnzik
 INSERT INTO public.orders (id, customer_id, status, amount, note) VALUES (382, 679322, 'cancelled',
-383	668107	shipped	5325.74	zu
 INSERT INTO public.orders (id, customer_id, status, amount, note) VALUES (384, 442363, 'new', 6149.
 385	359182	cancelled	475.15	ztbyhdlmxk
 INSERT INTO public.orders (id, customer_id, status, amount, note) VALUES (386, 967299, 'shipped', 4

Git's own headers stay, and the hunks come from Rift. Other files keep git's diff, because only *.sql is named in .gitattributes.

Before you rely on it

The full setup, including git difftool for the terminal view, is in the git guide.