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 18:04:53 -0500

Good evening all,

I have attached an example that I hope helps.

Thomas, the gitCommitish I am using is the same as the one linked at:  

https://github.com/openlilylib/snippets/blob/master/editorial-tools/git-commands/

So after committing the LilyPond files to the repository, the current git version will appear in the tagline when you rebuild the pdf since that value is extracted in the tagline entry. What I seek is a way to get that value appended automatically to the generated pdf so that the generated pdf would have a filename such as:

CommitishExample-0490435.pdf.

Using \bookOutputSuffix seemed like a good place to start, but as Thomas has pointed out, \bookOutputSuffix "\gitCommitish" or \bookOutputSuffix \gitCommitish does not work.

Elaine has a good idea to extract that information at the shell and then append it to the filename using shell functions. I had not thought of that method before. I will work on a shell script for that and see what come out of that.  

David, 

My apologies for referring you to the place where the git definitions I used were. I thought that was information you were looking for.  

Thanks to all for your help,

Ben


On Sun, 2018-01-14 at 12:17 -0800, Flaming Hakama by Elaine wrote:
---------- Forwarded message ----------
From: Ben Beeson <address@hidden>
To: David Kastrup <address@hidden>, lilypond-user <address@hidden>
Subject: Re: How to append a git version to an output filename
Hi David,

...

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.




I'm unclear on what you want the git version of.  I can only assume it is one of the lilypond source files.

In any case, if it something to do with the git commit version of a file, you can get that from the command line, such as using something like:

 git log $file | head -1 | sed 's/commit //'




And then there is a way to execute a shell command from within lilypond, and assign it to a variable.  Which I'm not familiar with, but I've read on this list about people doing so.  I'd bet you could find that in the mail archives.



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




HTH, 

David Elaine Alt
415 . 341 .4954                                           "Confusion is highly underrated"
address@hidden
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 

Attachment: CommitishExample.ly
Description: Text Data

Attachment: CommitishExample.pdf
Description: Adobe PDF document


reply via email to

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