Re: Generate version file by hooks

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

 



2009/3/17 Björn Hendriks <bjoern01@xxxxxxxxxxxxxx>:
>
> Hello,
>
> I'd like to put the SHA1 of the current commit into a source file so that my
> program can further process it -- put it into a log file for example.

You can look at what is done in git itself with the version number.
There is a GIT-VERSION-GEN that generates a GIT-VERSION-FILE with the
version number (it only updates the file if the version number has
changed). Then in the makefile you specify how to create it and which
programs depend on the GIT-VERSION-FILE:

GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
-include GIT-VERSION-FILE

program: GIT-VERSION-FILE

HTH,
Santi
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux