Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Diff
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== History == diff was developed in the early 1970s on the Unix operating system, which was emerging from [[Bell Labs]] in Murray Hill, New Jersey. It was part of the 5th Edition of Unix released in 1974,<ref>https://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/diff1.c</ref> and was written by [[Douglas McIlroy]], and [[James W. Hunt|James Hunt]]. This research was published in a 1976 paper co-written with James W. Hunt, who developed an initial prototype of {{Mono|diff}}.<ref name="diff paper">{{cite journal|author1=James W. Hunt|author2=M. Douglas McIlroy|title=An Algorithm for Differential File Comparison|volume=41|journal=Computing Science Technical Report, Bell Laboratories|date=June 1976|url=http://www.cs.dartmouth.edu/~doug/diff.pdf|access-date=2015-05-06|archive-date=2014-12-26|archive-url=https://web.archive.org/web/20141226005228/http://www.cs.dartmouth.edu/~doug/diff.pdf|url-status=live}}</ref> The algorithm this paper described became known as the [[Hunt–Szymanski algorithm]]. McIlroy's work was preceded and influenced by [[Stephen C. Johnson|Steve Johnson]]'s comparison program on [[GECOS]] and [[Mike Lesk]]'s {{Mono|proof}} program. {{Mono|Proof}} also originated on Unix and, like {{Mono|diff}}, produced line-by-line changes and even used angle-brackets (">" and "<") for presenting line insertions and deletions in the program's output. The [[heuristic]]s used in these early applications were, however, deemed unreliable. The potential usefulness of a diff tool provoked McIlroy into researching and designing a more robust tool that could be used in a variety of tasks, but perform well in the processing and size limitations of the [[PDP-11]]'s hardware. His approach to the problem resulted from collaboration with individuals at Bell Labs including [[Alfred Aho]], Elliot Pinson, [[Jeffrey Ullman]], and Harold S. Stone. In the context of Unix, the use of the [[ed (Unix)|{{Mono|ed}}]] line editor provided {{Mono|diff}} with the natural ability to create machine-usable "edit scripts". These edit scripts, when saved to a file, can, along with the original file, be reconstituted by {{Mono|ed}} into the modified file in its entirety. This greatly reduced the [[secondary storage]] necessary to maintain multiple versions of a file. McIlroy considered writing a post-processor for {{Mono|diff}} where a variety of output formats could be designed and implemented, but he found it more frugal and simpler to have {{Mono|diff}} be responsible for generating the syntax and reverse-order input accepted by the {{Mono|ed}} command. In 1984, [[Larry Wall]] created a separate utility, [[patch (Unix)|patch]], releasing its source code on the ''mod.sources'' and ''net.sources'' newsgroups.<ref>{{cite newsgroup | title = A patch applier--YOU WANT THIS!!! | author = Larry Wall | date = November 9, 1984 | newsgroup = net.sources | message-id = 1457@sdcrdcf.UUCP | url = https://groups.google.com/d/msg/net.sources/qtfVio1sSHs/G0cPT5HFDFcJ | access-date = May 11, 2015 | archive-date = February 19, 2022 | archive-url = https://web.archive.org/web/20220219233604/https://groups.google.com/g/net.sources/c/qtfVio1sSHs/m/G0cPT5HFDFcJ | url-status = live }}</ref><ref>{{cite newsgroup | title = patch version 1.2--YOU WANT THIS | author = Larry Wall | date = November 29, 1984 | newsgroup = net.sources | message-id = 1508@sdcrdcf.UUCP | url = https://groups.google.com/d/msg/net.sources/uWFr9NOp_fw/SRS_P2vSgFgJ | access-date = May 11, 2015 | archive-date = March 21, 2020 | archive-url = https://web.archive.org/web/20200321140052/https://groups.google.com/forum/ | url-status = live }}</ref><ref>{{cite newsgroup | title = patch version 1.3 | author = Larry Wall | date = May 8, 1985 | newsgroup = net.sources | message-id = 813@genrad.UUCP | url = https://groups.google.com/d/msg/mod.sources/xSQM63e39YY/apNNJSkJi0gJ | access-date = May 11, 2015 | archive-date = February 19, 2022 | archive-url = https://web.archive.org/web/20220219233604/https://groups.google.com/g/mod.sources/c/xSQM63e39YY/m/apNNJSkJi0gJ | url-status = live }}</ref> This program modifies files using output from {{Mono|diff}} and has the ability to match context. [[X/Open]] Portability Guide issue 2 of 1987 includes diff. Context mode was added in POSIX.1-2001 (issue 6). Unified mode was added in POSIX.1-2008 (issue 7).<ref>{{man|cu|diff|SUS}}</ref> In {{Mono|diff}}'s early years, common uses included comparing changes in the source of software code and markup for technical documents, verifying program debugging output, comparing filesystem listings and analyzing computer assembly code. The output targeted for {{Mono|ed}} was motivated to provide compression for a sequence of modifications made to a file.{{citation needed|date=May 2023}} The [[Source Code Control System]] (SCCS) and its ability to archive revisions emerged in the late 1970s as a consequence of storing edit scripts from {{Mono|diff}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)