Menu

#16 Version info should include SVN revision

0.10
closed-fixed
nobody
UrJTAG (101)
5
2007-12-15
2007-11-25
No

UrJTAG already states that it is "0.6" when started. At least at the moment many people use the code from the subversion repository. We'll run into problems later when all just claim to run "version 0.6"...

Discussion

  • Arnim Läuger

    Arnim Läuger - 2007-11-27

    Logged In: YES
    user_id=156321
    Originator: NO

    I agree that we should set up such an identification.
    At another project (http://sdcc.sf.net/) I've seen the following mechanism:
    * ChangeLog contains the $Revision$ tag
    * during make, some awk scripting copies ChangeLog's SVN revision number to version.h
    * version.h is included e.g. in the code that prints the tool's version

    This however requires that ChangeLog (or any other file) is updated with each check-in to keep revision numbers consistent. Not a bad thing, IMO :-)

     
  • Kolja Waschk

    Kolja Waschk - 2007-11-27

    Logged In: YES
    user_id=478715
    Originator: YES

    The revision info could be extracted e.g. from the .svn/entries file(s). Tiny tools exist which can create .h from .svn info, e.g. http://www.compuphase.com/svnrev.htm - at work we're using subwcrev.exe (comes with TortoiseSVN for Windows...) which even notes whether the working copy has local modifications.

     
  • Kolja Waschk

    Kolja Waschk - 2007-11-27

    Logged In: YES
    user_id=478715
    Originator: YES

    However, the $Revision$ from ChangeLog would be easier to gather. The format of files in .svn might change with Subversion releases (as did the "entries" format).

    Currently, the version comes from configure.ac, which also carries a $Revision$, but not as often as a ChangeLog would [should].

     
  • Arnim Läuger

    Arnim Läuger - 2007-12-05

    Logged In: YES
    user_id=156321
    Originator: NO

    Added scripting to copy the Revision tag from ChangeLog to src/version.h. I had to move the tag to the end of ChangeLog since emacs inserts new entries automatically at the top of this file (C-x 4 a). However, the revision number is used in src/jtag.c main() as the "Build" number.
    Please check how this matches your initial idea.

     
  • Kolja Waschk

    Kolja Waschk - 2007-12-09
    • labels: --> UrJTAG
    • milestone: --> 0.x
    • status: open --> closed-fixed
     
  • Kolja Waschk

    Kolja Waschk - 2007-12-09

    Logged In: YES
    user_id=478715
    Originator: YES

    In #829: The revision is gathered by ./configure and written to config.h. It first tries "svn info" (which works only if a. svn is installed and b. it runs in an actual working copy, not just in an unpacked distribution.tar.gz) followed by the awk on ChangeLog followed by defining SVN_REVISION to 0.

     
  • Arnim Läuger

    Arnim Läuger - 2007-12-12

    Logged In: YES
    user_id=156321
    Originator: NO

    Works fine on a fresh checkout. But if config.h is already present then make doesn't update config.h although the revision number changed.
    Observed after commit of r835 and r836:
    SVN revision number incremented in ChangeLog but config.h still shows '#define SVN_REVISION "831"'.
    Running ./configure yields "831" again - guess because 'svn info' still is at 831. How should I address this?

     
  • Kolja Waschk

    Kolja Waschk - 2007-12-13

    Logged In: YES
    user_id=478715
    Originator: YES

    I've added the "-R" option to "svn info" and some more awk code (just learning awk that way...) After committing #837, "svn info" still shows 836, but config.h knows better: 837. More checks could be added to determine if any files aren't up-to-date or modified, but that's less important. It should go into the code for "make dist" which already checks NEWS

     
  • Kolja Waschk

    Kolja Waschk - 2007-12-13
    • status: closed-fixed --> open-fixed
     
  • Kolja Waschk

    Kolja Waschk - 2007-12-15
    • status: open-fixed --> closed-fixed
     
  • Kolja Waschk

    Kolja Waschk - 2017-02-12
    • Group: 0.x --> 0.10
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →