Author Topic: Diffing modules  (Read 1401 times)

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 707
Diffing modules
« on: May 16, 2015, 13:27:46 »
Using version control for module files often points out that diffing modules even on rough scale could be useful. Without being of aware of existing solutions, I wrote a little hack to OpenMPT with which it is possible to set e.g. TortoiseSVN to use mptrack.exe with appropriate command line arguments to do module diffs [1]. Attached is the code and an example what the module diff looks like. Comparison is based on as-simple-as-possible module-to-text conversion (currently highly lossy, but covers big parts such as pattern data) and use of existing diff programs for the actual comparison. Note that this is a demonstration-of-concept type of patch and is by no means intended to be merged as such, but can be improved if this type of functionality is of interest.

[1] Diffing works from TortoiseSVN context menu by adding the following as handler of it/mptm etc. extensions:
"C:\Program Files (x86)\OpenMPT\mptrackWithDiffFunctionality.exe" /diff "C:\Program Files\TortoiseSVN\bin\TortoiseMerge.exe" %base %mine
« Last Edit: April 21, 2017, 17:22:34 by Relabsoluness »

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,128
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
Re: Diffing modules
« Reply #1 on: May 17, 2015, 21:08:57 »
Cool, this looks exactly like something I had on my mind for a very long time. I'm pretty sure we can bring this into a workable state for including into the main development branch.
ยป No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 707
Re: Diffing modules
« Reply #2 on: May 19, 2015, 16:41:09 »
I'll be expecting the next release then ;)

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 707
Re: Diffing modules
« Reply #3 on: May 26, 2017, 00:02:57 »
Old thread, but the matter is still topical. Attached is a new draft version of the diffing feature patch with the following changes:
  • Revamped writer interface.
  • Includes plain text and JSON output options with the latter implemented with RapidJSON for simplicity.
  • In JSON-writing, integers are now written as integers instead of strings.
  • Minor changes in the output content.
« Last Edit: May 26, 2017, 10:29:54 by Relabsoluness »