On Mon, 13 Jul 2015 06:14:08 -0400 Richard Hipp <d...@sqlite.org> wrote:
> On 7/13/15, Michael Weise <michael.we...@ek-team.de> wrote: > > Dear all, > > > > we've been using fossil for over a year now and are quiet happy with it. > > > > The next thing we'd like to do is to automatically put some version > > infomation from the fossil repository into the sourcecode. This will > > help us to know which checkout version was used for a specific build / > > executable. > > > > 1. Is this possible with fossil? > > 2. What approach can you recommend? > > > > Fossil itself does this. That's how the "fossil version" command is > implemented. You'll also see the version information at the bottom of > every pages at https://www.fossil-scm.org/ and on the > https://www.fossil-scm.org/fossil/stat page. SQLite also does this. > > Step 1: Run "fossil setting manifest on" for your repos so that > every checkout automatically includes the "manifest" and > "manifest.uuid" files in the root directory. The manifest.uuid file > contains the SHA1 hash of the most recent check-in. The manifest file > can be used to extract the date and time of the most recent check-in. > > Step 2: Adjust your makefile so that every build automatically reads > the manifest and manifest.uuid files to extract version information. > In SQLite, this is done using a TCL script. (You could use perl or > python or ruby or whatever else you find convenient.) In Fossil this > is done with a C program so that the Fossil build does not depend on > having any particular scripting language installed. The program used > by Fossil is https://www.fossil-scm.org/fossil/artifact/40ed302872cc5795 Thanks for all the answers, I wrote my own little script that extracts the output of 'fossil status' with the help of sed and writes it to a file. It's invoked as part of the build process: fossil status | sed -n 's/checkout: *\([a-zA-Z0-9]*\) \(.*\)/#ifndef CHECKOUTVERSION\n#define CHECKOUTVERSION\n#define CHECKOUT_VERSION_STRING "\1"\n#define CHECKOUT_TIMESTAMP_STRING "\2"\n#endif/p' > ../checkoutVersion.h What's the advantage of using a manifest file? Best regards, Michael _______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users