Rift Star on GitHubv0.3.0

Rift / Guide

--summary

The summary tells you how much differs between two files before you write the diff.

rift --summary a.sql b.sql
a.sql, b.sql: a 64 MiB pair
$ rift --summary a.sql b.sql
a: 843633 lines, 67108879 bytes
b: 845034 lines, 67182379 bytes
stratum 0, 830263 anchors
equal    436 segments, 835632 lines in a, 835632 in b
differs  435 segments, 8001 lines in a, 9402 in b
first differing ranges (0-based, end exclusive):
  a 381..383  b 381..382
  a 1005..1011  b 1004..1010
  a 1280..1281  b 1279..1281
  a 8109..8119  b 8109..8110
  a 9618..9619  b 9609..9618
  a 11782..11783  b 11781..11790
  a 17463..17784  b 17470..17471
  a 21556..21560  b 21243..21244
  a 22749..22750  b 22433..22437
  a 25037..25048  b 24724..24725
  ... and 425 more
moved    62 blocks, 2737 lines
  a 21557..21560  b 22434..22437
  a 25038..25048  b 26389..26399
  a 27627..27952  b 28206..28531
  a 36864..36874  b 36680..36690
  a 48226..48235  b 49457..49466
  a 50776..50780  b 50896..50900
  a 59441..59445  b 61396..61400
  a 65493..65499  b 65178..65184
  a 99590..99595  b 99830..99835
  a 110203..110209  b 111213..111219
  ... and 52 more
peak heap 78.6 MiB of 256.0 MiB (82397510 bytes)
time 0.13 s

Read it from the top:

The summary writes no diff, so it is the cheapest run. On a 1 GiB pair it finished in 0.51 s on the Linux machine on the benchmarks page.

Use --summary in a script to decide whether a diff is worth writing, or to see how many segments will need refining. The exit status follows diff: 1 when the files differ.