| 1 |
Handling of mscore/revision.h |
| 2 |
----------------------------- |
| 3 |
|
| 4 |
The copy of mscore/revision.h in the git repository is just a default, to |
| 5 |
prevent build failures from a freshly cloned or checked-out repo. It contains |
| 6 |
the string "Unknown" instead of a build number. |
| 7 |
|
| 8 |
It is always possible to update mscore/revision.h with the build number |
| 9 |
of the current checked-out branch by doing "make revision". However, the |
| 10 |
updated mscore/revision.h should never be commited back to git. This can |
| 11 |
be prevented manually by restoring the original value before committing, |
| 12 |
with "git checkout -- mscore/revision.h" |
| 13 |
|
| 14 |
But there is an easier way to achieve all this automatically... |
| 15 |
|
| 16 |
The post-checkout script in this directory should be installed as a hook in |
| 17 |
git, and will update mscore/revision.h with the branch number automatically |
| 18 |
when checking out a new branch. |
| 19 |
|
| 20 |
The hook also does "git update-index --assume-unchanged mscore/revision.h", |
| 21 |
so that git does not expect the updated mscore/revision.h file to be staged |
| 22 |
or committed. It also stops it from showing up in "git diff" or "git status". |
| 23 |
|
| 24 |
To install the hook from this directory, do: |
| 25 |
|
| 26 |
$ cp -p post-checkout ../../../.git/hooks/ |
| 27 |
|
| 28 |
Alternatively from the top-level directory, do: |
| 29 |
|
| 30 |
$ cp -p build/git/hooks/post-checkout .git/hooks/ |
| 31 |
|
| 32 |
This only needs doing once, and works for Linux, Windows (MinGW) and OSX. |