Diff

From NetHackWiki
Jump to navigation Jump to search

diff is a program that creates specially formed patch files. It compares two files, and outputs the differences in a format that can be used to recreate one of the files from the other. (These special files are called either patch-files or diff-files.)

The usual invocation of the program is something like this:

diff --new-file --unified --recursive --minimal original-nethack-dir/ changed-nethack-dir/


Instructions for using diff3

diff3(1) - compare three source files line by line (CLI).

First rename and place the desired files to same directory folder.

Synopsis:

diff3 sourcefile_one.txt sourcefile_two.txt sourcefile_three.txt

For example Graves have Headstones so let's see if there is new "epitaphs to random headstones" added between NetHack 3.6.0 and NetHack 5.0.0

Example command:

nethacker@NAO:~/games/NetHack/dat$ diff3  epitaph360.txt epitaph370.txt epitaph.txt

Produces terminal output (diff-file):

====
1:1c
 # NetHack 3.6  epitaph.txt       $NHDT-Date: 1524689580 2018/04/25 20:53:00 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.3 $
2:1c
 # NetHack 3.7  epitaph.txt       $NHDT-Date: 1596498241 2020/08/03 23:44:01 $  $NHDT-Branch: NetHack-3.7$: $NHDT-Revision: 1.4 $
3:1c
 # NetHack 5.0  epitaph.txt       $NHDT-Date: 1596498241 2020/08/03 23:44:01 $  $NHDT-Branch: NetHack-5.0 $:$NHDT-Revision: 1.4 $
====1
1:281a
2:282,283c
3:282,283c
 #"reached Mine's End": not necessarily true; sounds like "reached my end"
 I have reached Mine's End

There is no changes between versio 3.6.0 and 3.7.0 but 5.0.0 adds one new epitaph (and first ever comment to the text, which tries to explain the added pun).[1]

See Also

Reference