invoke the score-comparison view from command line

• Dec 5, 2020 - 18:13
Reported version
3.5
Type
Functional
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

Proposal to be able to invoke MuseScore from the command line with two scores that would be compared in the (already existing) "Score Comparison" view.

Currently, there is a --diff and a --raw-diffcommand line option. They both print information in the terminal window.

This is a proposal for a new option (for example --gui-diff) which would instead open two scores provided on the command line in the Score Comparison view.

A main use for this would be in a git repository where files are stored in the uncompressed .mscx format. The default behaviour of git diff works but it is not really useful to see the difference on the level of the xml-files. It is very difficult to understand what actually changed.

Currently you can define a "difftool" for musescore files in this way in the .git/config file in the git repo:

[diff]
    tool = musescore
[difftool "musescore"]
    cmd = MuseScore --diff $LOCAL $REMOTE

And you can then do a 'git difftool ' to see the printout of MuseScore --diff for the modified file. This works fine now. You can do

  • 'git difftool' to see all modifications files in the repo compared to the staging area
  • 'git difftool TestScore.mscx' to see the modifications in TestScore.mscx compared to the staging area
  • 'git difftool HEAD^ TestScore.mscx' to compare TestScore.mscx in the current commit with the same file in the previous commit.
  • etc

The problem is that the printout from --diff is not really complete, and definitely not good enough for more substantial changes. It is much easier to see the changes in the MuseScore window.

A possible future improvement is of course to also support "Merge" where you compare differences with a common ancestor version of the same file to determine which of the two versions introduced a change, and where there is support for resolving conflicts where both versions made changes in the same place. etc. This would then make it possible to also use MuseScore as a "git mergetool" which would be very convenient.