Hi,
I am using the function below which is adapted from
http://lilypondblog.org/2014/01/why-use-version-control-for-engraving-scores/#more-2151
While it works and the .ly files compile successfully, the function
issues a warning (?) I’d like to get rid of.
1) If the document is in a git directory, this is printed:
Parsing...git: /…path/to…/lilypond-2.20.0-1/lilypond/usr/lib/libz.so.1:
no version information available (required by git)
Where does it come from and why is it issued?
Doing `git --version` in bash does not issue it.
2) If the document is not in a git repository another log line is added:
fatal: not a git repository (or any of the parent directories): .git
Which I understand but I’d like to hide it anyways because I want to use
the same file no matter if it is used with git or not.
Any ideas how to achieve this?
Cheers,
Joram
%%%% code
\version "2.20.0"
#(use-modules (ice-9 popen))
#(use-modules (ice-9 rdelim))
#(define (strsystem_internal cmd)
(let* ((port (open-input-pipe cmd))
(str (read-line port)))
(close-pipe port)
str))
#(define gitshort (let* ((res (strsystem_internal
"git describe --long --dirty='+' | sed 's/-/./' | sed -r
's/-g[0-9a-f]+//g'")))
(if (string? res) res "")))
% if (string? ... is my clumsy way to ensure it returns a string
\markup { "Version" \gitshort }