On 6 January 2011 13:08, David Gowers (kampu) <[email protected]> wrote:
> On Thu, Jan 6, 2011 at 6:16 AM, James Paige <[email protected]> wrote:
>> On Thu, Jan 06, 2011 at 08:02:20AM +1300, Ralph Versteegen wrote:
>>> However f you don't build out of an svn or git repository (for
>>> example, if you download the nightly source) then you'll get a
>>> revision number of 0, which is awfully inconvenient. It would be nice
>>> the the build system cached the last know revision number somehow.
>>> Maybe this could also solve the problem of 'git svn info' taking
>>> longer than the actual compile under Windows! git-svn is written in
>>> fork-crazy perl, and spawning a process is something like thousands of
>>> times slower than it is on any Unix.
> just for comparison: 'git svn info' on the git-svn mirror of OHRRPGCE
> takes about 4 seconds.
>
>
>>>
>>> Anyway, if that problem is solved, I'm much in favour of it.
>
> what about

The problem I was talking about wasn't git-svn info being slow.

We should have a constant somewhere which, if set, overrides the svn
revision. Then we can lock the apparent revision number of all bugfix
re-releases of a release. Otherwise nightlies from before the release
wouldn't accept the files. This constant could also be set to the
current svn revision when packaging the nightly source dump.

But... I think I might prefer including the svn revision number in
addition to the RPG format version, and just showing a bit less
serious warning if it is from the future. I compile and run old
versions of game and custom on newer rpg files all the time, so would
personally find that useful.

> 'git log --grep=git-svn-id |grep -oEe
> 'ohrrpgce/.+@([0-9]+)'|head -n 1|grep -oEe '[0-9]+' ' ? (as a demo)
>
> outputs '4085' on my current checkout. Designed to handle the case
> where you have one or more commits that haven't yet been committed to
> SVN, only locally, as well as the case where you don't.
> The idea, if you don't speak grep-ese, is simply to find the log
> entries with 'git-svn-id' on some line, take the first one, and
> extract the bit of text following 'ohrrpgce/SVNBRANCHNAME@'
> (stopping at the next space)

This is excellent; I've patched my copy of verprint and am now
enjoying fast builds (on my old laptop without enough harddisk space
for python).

> Writing a little FB program to do that would probably be the most
> portable solution.

Indeed, -o is a recent addition to grep, and I had to download the
latest msys to get it to work on windows. But rather than write a FB
program, we should just add it to verprint.bas and ohrbuild.py

> .. it's been ages since I actually wrote any BASIC. pseudo-ish code follows:
>
>
> ' ** get the output of "git log --grep=git-svn-id"   (could be done in
> advance by the build system) **
> ' ** read lines until INSTR (thisline, "git-svn-id") > 0 **
>
> ' and now find the part of the line we want
> svnspecstart = INSTR (thisline, "svn://")
> svnspecnumstart = INSTR (thisline, '@', svnspecstart) + 1
> svnspecnumend = INSTR (thisline, ' ', svnspecnumstart)
> version = MID (thisline, svnspecnumstart, svnspecnumend - svnspecnumstart)
> PRINT version
> _______________________________________________
> Ohrrpgce mailing list
> [email protected]
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to