GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wpdevelopment11/diff: A reasonably fast diff utility and library in Python. It implements the Hunt–McIlroy algorithm and prints results in the so-called "normal format."

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
diff
diff
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
diff-cli.py
diff-cli.py
 
 
image.png
image.png
 
 
lcs-cli.py
lcs-cli.py
 
 
parser.py
parser.py
 
 

Repository files navigation

Implementation of the Hunt-McIlroy algorithm and the diff command-line utility

diagram that shows how the diff utility works

Command-line utilities

diff-cli.py - Print the diff of the two files or strings

The diff is printed in the normal output format.

Usage:
diff-cli.py [-h] [-s] fileA fileB

Print the diff. In other words, print the changes needs to be done to the first file to produce the second one.

Positional arguments:
  fileA          Path to the first file
  fileB          Path to the second file

Options:
  -s, --strings  Interpret both arguments as strings
  -h, --help     show this help message and exit

lcs-cli.py - Print the longest common subsequence between the two files or strings

Usage:
lcs-cli.py [-h] [-s] fileA fileB

Print the longest common subsequence (LCS) between the two files.

Positional arguments:
  fileA          Path to the first file
  fileB          Path to the second file

Options:
  -s, --strings  Interpret both arguments as strings
  -h, --help     show this help message and exit

API

Find the longest common subsequence (LCS) of the two sequences.

LCS(seq_a, seq_b)

Given the LCS and the two sequences create the hunks of differences.

get_hunks(lcs, seq_a, seq_b)

Run tests

python -m unittest discover test

About

A reasonably fast diff utility and library in Python. It implements the Hunt–McIlroy algorithm and prints results in the so-called "normal format."

Topics

build-your-own-xdiffing-algorithmgit-delta

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.