It looks possible to count the total number of commit in all branches and use
that as an incrementing revision number:

https://stackoverflow.com/questions/677436/how-do-i-get-the-git-commit-count

Sebastien

Le 15/04/2019 à 06:32, Al Beard a écrit :
> Hi Bob,
>
> ==== A GIT version/hash ==========
> From:
> http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/
>
> In CMakeLists.txt
> # Get the latest GIT abbreviated commit hash of the working branch
> execute_process(
>   COMMAND git log -1 --format=%h
>   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
>   OUTPUT_VARIABLE GIT_COMMIT_HASH
>   OUTPUT_STRIP_TRAILING_WHITESPACE
> )
>
> #
> # Find the svn revision if this is a working copy.
> <snip>
>     endif(Subversion_FOUND)
> else()
>     add_definitions(-DSVN_REVISION="${GIT_COMMIT_HASH}")
> endif()
>
> ========== GIT_COMMIT_HASH =========
>
> So I now have some kind of version number, better than "None".
>
> Alan VK2ZIW
>
>
>
> On Sun, 14 Apr 2019 21:51:57 -0400, Boudewijn (Bob) Tenty wrote
>> Hi Alan,
>>
>> git describe or git describe --tags is only useful if somebody puts 
>> in a tag!
>>
>> Normally you put a version number in the tag, that tag is missing here.
>>
>> git describe -- always   gives  the first seven hexadecimal 
>> numbers of the commit hash
>>
>> Bob VE3TOK
>>
>> On 2019-04-14 5:59 p.m., Al Beard wrote:
>>> Hi Bob,
>>>
>>> Actually "git describe --tags" is not useful as one has to know and name
>>> the tag required.
>>>
>>> "git describe --always"   is more useful.
>>>
>>> and returns "add9aa4" (now).
>>>
>>> Which is at least unique to "when" I downloaded the code.
>>>
>>> Can I ask a "git" guru to add something to CMakeLists.txt so we can
>>> have a useful Revision number?
>>>
>>> Alan VK2ZIW
>>>
>>>
>>> On Sat, 13 Apr 2019 19:23:27 -0400, Boudewijn (Bob) Tenty wrote
>>>> git describe --tags
>>>>
>>>> Bob VE3TOK
>>>>
>>>> On 2019-04-13 5:40 p.m., Al Beard wrote:
>>>>> Hi all,
>>>>>
>>>>> Lightning destroyed threee radios here including the FT-450D
>>>>> running my Codec2 repeater.
>>>>>
>>>>> BUT
>>>>>
>>>>> I have to replace the feedline (RG58) as this took all the
>>>>> lightning current. Actually it was the tree next door that took
>>>>> the main hit. And I haven't looked in the AT-220 tuner.
>>>>>
>>>>> I now have an FT-857D.
>>>>>
>>>>> The Banana Pi running "parrot" survived, helped by the audio
>>>>> isolation transformers and the Opto for PTT.
>>>>>
>>>>> BTW: Versioning, how do I get the Git version number as I did
>>>>> with SVN?
>>>>>
>>>>> Alan VK2ZIW
>>>>>
>>>>> ---------------------------------------------------
>>>>> Alan Beard
>>>>>
>>>>> OpenWebMail 2.53
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Freetel-codec2 mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>>>> --
>>>>
>>>> When you change the way you look at things, the things you look at
>>> [UTF-8?][UTF-8?]change 
>>>> Max Planck
>>>>
>>>> _______________________________________________
>>>> Freetel-codec2 mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>>> ---------------------------------------------------
>>> Alan Beard
>>>
>>> OpenWebMail 2.53
>>>
>>>
>>>
>>> _______________________________________________
>>> Freetel-codec2 mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>> --
>>
>> When you change the way you look at things, the things you look at
> [UTF-8?]change 
>> Max Planck
>>
>> _______________________________________________
>> Freetel-codec2 mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>
> ---------------------------------------------------
> Alan Beard
>
> OpenWebMail 2.53
>
>
>
> _______________________________________________
> Freetel-codec2 mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freetel-codec2


_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2

Reply via email to