On Fri, Mar 25, 2016 at 10:24:57PM +0300, Dmitry Yemanov wrote:
> 25.03.2016 22:19, Michal Kubecek wrote:
> 
> >    timestamp='$Format:%ct$'
> >    if [ "${timestamp:0:1}" = '$' ]; then
> >        ts=`git log -1 --pretty='%ct'`
> >    fi
> >    build_num=$[timestamp / 86400 - 16811]
> 
> This gives us a buildno counted in days, not in commits (as now).

Yes, but I'm not sure if it's really a problem.

One thing I had to learn when I started to work on projects using git
was that with nonlinear git history, the idea of a linear version
counter can be approximated to some extent but it can't really work in
general. And that the only reliable identifier of a point in a git tree
is the commit id.

We might combine the date based build number that would be backward
compatible and would nicely identify the daily snapshots with
(abbreviated) commit id of the actual source version which would give
precise identification for

  - daily snapshots
  - snapshots downloadad from Github web interface
  - snapshots generated locally with "git archive"
  - builds directly from (local) git repository

This woudln't, of course, work for builds from commits outside the main
branch but at least it would be easy to see this is the case.

                                                         Michal Kubecek

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to