Skip to content

Add giffdiff functions - #99

Merged
guillep merged 3 commits into
Pharo15from
add-giffdiff-functions
Sep 8, 2026
Merged

Add giffdiff functions#99
guillep merged 3 commits into
Pharo15from
add-giffdiff-functions

Conversation

@estebanlm

Copy link
Copy Markdown
Collaborator

this allows me to make a diff compare using lib git mechanism. Is barebones but it may be used in the future to enhance some merge info.
Usage:

LGitLibrary uniqueInstance initializeLibGit2.

s1 := 'xx1
yy
zz'.
s2 := 'xx2
xy
zz'.

diff := LGitDiff basicNew.

opts := LGitDiffOptions defaults.

lines := OrderedCollection new.
lineCallback := LGitDiffLineCallback on: [ :delta :hunk :line :payload |
	lines add: { line prim_origin. line prim_new_lineno. line content }. 
	0 ].

diff 
	diff_buffers: s1 
	old_len: s1 size  
	old_as_path: 'old.st' 
	new_buffer: s2 
	new_len: s2 size 
	new_as_path: 'new.st' 
	options: opts 
	file_cb: ExternalAddress null 
	binary_cb: ExternalAddress null
	hunk_cb: ExternalAddress null
	line_cb: lineCallback 
	payload: ExternalAddress null. "a LGitReturnCodeEnum(#git_ok [0])"

lines

@guillep
guillep changed the base branch from Pharo14 to Pharo15 September 8, 2026 08:41
@guillep
guillep merged commit af8c1ab into Pharo15 Sep 8, 2026
@guillep
guillep deleted the add-giffdiff-functions branch September 8, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants