> Am Mo den  2. Mai 2016 um 18:53 schrieb Josef Kufner:
>> Git hooks are not the right tool for this task. It is better to run `git
>> describe` during the build process to generate a version file, which
>> will be compiled in and shown by `geeqie --version`.
> 
>> It is easy to automatically generate version.h with few #define
>> statements or something like that and include it wherever neccessary.
> 
> Yes. That is also what I think about that.
> 
> But there is a problem when people use the tarbal to build their
> version.
> 
> So the version has to be in the checked out file. There is some substs
> that could be used eventually. But finally it has to be set with
> checkin, so a hook. Unfortunately for a hook, every developer has to
> have them in all the clones. There is no way to manage them within git.
> 
> Nevertheless, it is easy to have just "master" in version information.

Tarball from Github contains root directory named geeqie-1.2.3. So there
is a reasonable fallback. Not perfect, but good enough.

Simply force generation of version.h during build and it will be fine.
Hooks are much more problematic. I use generated version info in all my
projects and it works very well.

My last Qt project used this in qmake project file:

  GIT_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD \
        describe --always --tags)
  DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"

It results in gcc -DGIT_VERSION=\"1.2.3\" ...

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to