Ignoring trivial changes

Boylan, Ross Ross.Boylan at ucsf.edu
Fri Mar 15 19:28:48 UTC 2019


Sometimes there are changes that are of no substantive interest, e.g., change in the date on the banner of a listing file or a change in dimensions of an object (e.g., text file included "Right = 800" and now is "Right = 845").  I would like advice on how to handle this, in two senses: the mechanics of how to do this, and what I should be doing.  The first is more straightforward, and so I'll start with it.

This is like EOL or other whitespace differences, including the fact that the "trivial" differences are sometimes so numerous that they obscure the real differences.

HOW
Is there a way to associate different diff tools with different file extensions?
I did this before (code now vanished), and am not sure how I got around this.  The merge tools seem to allow association of different tools with different file extensions, but not the diff tools.
I may have just written a custom diff that checked the file extension.

Previously I think I normalized the files by stripping line numbers and dates and then doing a diff; that was for SAS .lst files.
Currently I'm more focused on exported MS-Access source code.

What if I want the change to affect other things, e.g., status or merge?  That is, if the only changes are trivial, status reports no change and merge thinks there is nothing  to merge.

WHAT
If a file has only trivial changes, should I commit them anyway?
If a file has only trivial changes, what status should it show?  
The "should" here means the most desirable behavior, not how hg currently behaves.

Obviously if I adopt the normalization strategy, for example all occurrences of "Right=123", where 123 is any digit sequence, becomes
"Right=N" where "N" is literal, I would not want to commit the normalized version of the file.

Thanks for your thoughts.
Ross


More information about the Mercurial mailing list