GNU bug report logs - #79775
Use a program to define line-wise (not file-wise) comparison

Previous Next

Package: diffutils;

Reported by: Carl Ponder <cponder <at> nvidia.com>

Date: Thu, 6 Nov 2025 04:35:01 UTC

Severity: wishlist

Found in version 1:3.10-1build1

To reply to this bug, email your comments to 79775 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#79775; Package diffutils. (Thu, 06 Nov 2025 04:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Ponder <cponder <at> nvidia.com>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 06 Nov 2025 04:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Ponder <cponder <at> nvidia.com>
To: <submit <at> debbugs.gnu.org>
Subject: Use a program to define line-wise (not file-wise) comparison
Date: Wed, 5 Nov 2025 17:21:28 -0600
Package: diffutils
Version: 1:3.10-1build1
Severity: wishlist

This form allows me to use a program to compare 2 files and use sdiff to 
format the results:

sdiff --diff-program=PROGRAM ...

What I *really* want to do is define my own line-wise comparison, 
though, so "sdiff" will show lines as matching if the approximately 
match in a way I specify.
Allowing me to pass positional arguments to the comparator would give me 
flexibility without having to write a unique comparator program for each 
case.
Here are two examples:

sdiff --comparator-program=prefix --comparator-arg="5" ...
sdiff --comparator-program=field --comparator-arg='\d+ (\d+) .*' 
--comparator-arg='\d+ \d+ (\d+) .*' ...

The first case would match the first 5 characters of each line. The 
second case would match numbers in the second column of the first line 
with the third column of the second line.
Note that "sdiff" doesn't have to process these arguments, it just 
passes them verbatim as positional-parameters to the comparator program, 
along with the 2 lines being compared.
The comparator programs would just be executables, written any way 
that's convenient.





This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.