programRevision is not shown in Score Properties dialog for score from 2.0 and later

• Dec 23, 2016 - 12:36
Reported version
2.1
Type
Functional
Severity
S4 - Minor
Status
closed
Project

In 1.x the Revision was a plain int, like 5702 for MuseScore 1.3, and gets displayed as that when opening a 1.x file in 2.0, 2.1 or 3.0
In 2.0 though (actually since the move to git and GitHub) it is a SHA, containing digits and letters, a hex value, but still gets read in as an int, and, probably because not preceeded with a 0x, as a decimal int, this fails, because of the letters in the string, so gets interpreted and shown as 0. Also that revision field is limited to a max. of 99999, 5 decimal digits, while the SHAs (typically?) have 7 hex digits (at least)


Comments

programRevision, API-Level and MuseScore verson get updated to the current running one, once autosave kicks in.
This could get prevented by not autosaving 'imported' 1.x or 2.x score as long as they have not been modified. Added a corresponding commit to my PR for master (adding something equivalent to the 2.1 PR is yet to be done)
See also #152211: API-Level in Score Properties dialog shows the one from the version running, rather than the one from the score

Status (old) patch (code needs review) fixed

Fixed in branch 2.1, commit 67dd683c9d

fix #152206: Revision is not shown in Score Properties

for scores from 2.0 (or later?), actually for scores created after the
move from sourceforge to GitHub

Status (old) fixed active

Hmm, there's still something wrong, in master and master "My First Score" gets shown as github-musescore-musescore-35431 while it actually is 3543170

And it gets truncated to 5 digits (and a bit) for other scores. Hmm actually maybe the same problem?

Does this not work? Any better way to reserve space for (at least) 7 (hex) digits?
Increasing that 0xfffffff to INT_MAX improves this, but doesn't fix it, it still truncates after 6 digits and a bit (the last digit is only partly visible).

Status (old) closed needs info

Testing with 2.1 RC—revision is shown at first, but after saving, it reverts to 0. Is this intended behavior?

Correction: 2.1 shows the revision on reload, master does not. Both show revison as 0 on save.
No idea why.

Hmm, actually for master 5a42b3833 the Git SHA is not 7, but 9 digits now? See the post-checkout hook which calls `git parse-rev --short HEAD >/mscore/Revision.h` changed behavoir, it is documented to give a length of 7 if not told otherwise via `--short=n`. Change the hook to using `--short=7` fixes the display on reload.
Seems only to be an issue on self-built versions, not for the nightly builds. Probably down to a difference in git versions being used?
See https://github.com/musescore/MuseScore/pull/3145