lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to append a git version to an output filename


From: Ben Beeson
Subject: Re: How to append a git version to an output filename
Date: Sun, 14 Jan 2018 11:06:41 -0500

Hi David,

Here is how I get the \gitCommitish in the tagline. First, include the "gitDefinitions.ily" file. I use something like this:

\include "/home/workspace/include/gitDefinitions.ily"

Then in the header declaration, add the \gitCommitish and any other items desired to the tagline entry:

\header { 
          title = "Title"
          composer = ""
          arranger = ""
          meter = ""
          tagline = \markup { \filename  " " \source " "  git Version: \gitCommitish  Committed: \gitDateTime
          Engraved:
          \simple #(strftime "%d - %b - %Y - %H%M  " (localtime (current-time)))
               }    
}

An example tagline from a score I am editing presently looks like this:



Here \source is just a note to remind me where I got the information i used. This could be person's name or whatever. For the tagline above, \source is "null", so that value is missing from the tagline. I hope that the above is helpful to others.

Regarding your comment about adding an _expression_ to \bookOutputSuffix -- that is what I am trying to do. That said,

\bookOutputSuffix "\gitCommitish" or \bookOutputSuffix = \gitCommitish does not work as expected.  

What I seek is a way to append whatever the current git version is to the pdf filename that is generated so I don't have to open the pdf and check the tagline to see what version it is when searching for a specific version. Appending the git version to the filename would make it easier to know which version is represented by the pdf when searching through the directory.

The Guile information I have seen so far online has not been too helpful for this particular question. If anyone has any ideas, I would enjoy seeing those.

Cheers,

Ben







On Sun, 2018-01-14 at 11:37 +0100, David Kastrup wrote:
Ben Beeson <address@hidden> writes:

Hello all,

I am using git to keep track of edits to scores and am presently using 


\bookOutputName "score-filename" 
 
to write the output filename for the pdf that is generated in the
LilyPond "ly" file.  I am also using  

"git Version: \gitCommitish " 

in the tagline so the generated pdf has the git version information
included in the score that is generated.

How would that work?

I am wondering if there is a way to include \gitCommitish in
\bookOutputSuffix so that the output filename looks like:

"score-filename-gitversion.pdf".

So far I have not been able to figure out how to do that or find an
existing solution in the snippets, forum or elsewhere.   If anyone has
a solution, please share it.

It's easy to use any Guile string _expression_ as argument to
\bookOutputSuffix but I have no idea how you manage to get the Commitish
into the tagline.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]