| [ << LSR work ] | [Top][Contents] | [ Issues >> ] |
| [ < Approving snippets ] | [ Up : LSR work ] | [ Fixing snippets in LilyPond sources > ] |
7.4 LSR to Git
Introduction
Snippets used in the documentation are in
‘$LILYPOND_GIT/Documentation/snippets’. This directory
contains a complete set of the snippets in the LSR which are
tagged with ’docs’. The exact method for getting them there is
described below, but in essence they come from downloading a
tarball from the LSR and importing into the directory using the
makelsr script.
Any snippets which are too bleeding edge to run on the LSR (which uses a stable development version) are put into ‘$LILYPOND_GIT/Documentation/snippets/new’. Once the LSR has been upgraded so that these will run, then they are transferred to the LSR and deleted from ‘/snippets/new’.
’Git’ is the shorthand name for the Git repository that contains all the development code. For further information on setting this up see, Working with source code. An alternative to setting up a Git repository for people wanting to do LSR work is to get the source code from https://lilypond.org/website/development.html.
Importing the LSR to Git
-
Make sure that
convert-lyscript and thelilypondbinary are a bleeding edge version – the latest release or even better, a fresh snapshot from Git master, with the environment variableLILYPOND_BUILD_DIRcorrectly set up, see Environment variables. -
Start by creating a list of updated snippets from your local
repository. From the top source directory, run:
scripts/auxiliar/makelsr.py
Commit the changes and make a patch. Check the patch has nothing other than minor changes. If all is good and you’re confident in what you’ve done, this can be merged directly to
master. -
Next, download the updated snippets and run
makelsr.pyagainst them. From the top source directory, run:wget http://lsr.di.unimi.it/download/lsr-snippets-docs-`date +%F`.tar.gz tar -xzf lsr-snippets-docs-`date +%F`.tar.gz make -C $LILYPOND_BUILD_DIR scripts/auxiliar/makelsr.py lsr-snippets-docs-`date +%F`
where
date +%Fgives the current date in format YYYY-MM-DD (the snippets archive is usually generated around 03:50 CET, you may want to usedate -d yesterday +%Finstead, depending on your time zone and the time you run this commands sequence).makeis included in this sequence so thatmakelsrcan runlilypondandconvert-lyversions that match current source tree; you can select different binaries if desired or needed, to see options for this doscripts/auxiliar/makelsr.py --help
-
Follow the instructions printed on the console to manually check for
unsafe files. These are:
Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY! git add Documentation/snippets/*.ly xargs git diff HEAD < lsr-unsafe.txt
First, it’s important to check for any added files and add them to the files git is tracking. Run
git statusand look carefully to see if files have been added. If so, add them withgit add.As the console says,
makelsrcreates a list of possibly unsafe files in ‘lsr-unsafe.txt’ by runninglilypondagainst each snippet using the-dsafeswitch. This list can be quite long. However, by using the commandxargs git diff HEAD < lsr-unsafe.txtgit will take that list and check whether any of the snippets are different from the snippet already in master. If any is different it must be checked manually VERY CAREFULLY.Note: Somebody could sneak a
#'(system "rm -rf /")command into our source tree if you do not do this! Take this step VERY SERIOUSLY.If there is any doubt about any of the files, you are strongly advised to submit a merge request to get review.
-
If a review is not needed, merge to
masterafter the changes passed automatic testing.
Note that whenever there is a snippet in
‘Documentation/snippets/new’ and another from the LSR with
the same file name, makelsr.py will overwrite the LSR
version with the one from ‘Documentation/snippets/new’.
| [ << LSR work ] | [Top][Contents] | [ Issues >> ] |
| [ < Approving snippets ] | [ Up : LSR work ] | [ Fixing snippets in LilyPond sources > ] |