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 - SmartBear/lhdiff: A Lightweight Hybrid Approach for Tracking Source Lines

This repository was archived by the owner on Nov 5, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

45 Commits
45 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cmd/lhdiff
cmd/lhdiff
 
 
.gitignore
.gitignore
 
 
.goreleaser.yml
.goreleaser.yml
 
 
.whitesource
.whitesource
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
GetContext_test.go
GetContext_test.go
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
history.sh
history.sh
 
 
lhdiff.go
lhdiff.go
 
 
lhdiff_test.go
lhdiff_test.go
 
 
tfidf_cosine_similarity.go
tfidf_cosine_similarity.go
 
 

Repository files navigation

Test

lhdiff

A Lightweight Hybrid Approach for Tracking Source Lines.

Lhdiff provides a mapping of individual lines between two revisions of the same file. It provides a better mapping than Unix diff, and works independently of the file contents (programming language). See ARCHITECTURE.md for more details.

Install

go get github.com/SmartBear/lhdiff

To install from source, see CONTRIBUTING.md

Usage

There are two ways to use lhdiff - as a commandline program, or as a library

Command line

lhdiff [--compact] left right

Example using git:

lhdiff --compact \
<( git show 400a62e39d39d231d8160002dfb7ed95a004278b:cmd/lhdiff/main.go ) \
<( git show 35f1ba7b554d69a07e59d6f69297d08599f4217c:cmd/lhdiff/main.go )

lhdiff --compact \
<( git show 085519173c4e6e76c425dac0a628f21ff0cdcfa8:lhdiff.go ) \
<( git show 4ae3495de0c31675940861592a3929df8154785f:lhdiff.go )

Library

left := `one two three four
eight
nine ten eleven twelve
thirteen fourteen fifteen`

right := `one two three four
nine ten twelve
five six BANANA seven eight
APPLE PEAR
thirteen fourteen fifteen
`

linePairs := Lhdiff(left, right, 4)
PrintLinePairs(linePairs, false)

// Output:
// 1,1
// 2,_
// 3,2
// 4,5

Related

  • diffsitter
  • Incremental Origin Analysis of Source Code Files

LICENSE

MIT License

This is distributed under the MIT License.

About

A Lightweight Hybrid Approach for Tracking Source Lines

Resources

Readme
License

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

3 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

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.