Skip to content

MS Visual Studio header generator for VERSIONINFO from git-describe during pre-build event.

Notifications You must be signed in to change notification settings

ioannis-e/git-vs-versioninfo-gen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

Git - Visual Studio VERSIONINFO Generator
=========================================

Overview
--------
This project uses an MS-DOS batch file to parse the output of git-describe and
generate a header to be included in a project's file version resource.  For
building from source without having git the script can use a version file or
embedded default value.

Usage
-----
This can be run from the command line.  It uses the following arguments:

  usage: [--help] ^| [--verbose] ^| [--force] [--quiet] [CACHE_PATH] [OUT_FILE]

  When called without arguments, basic version information writes to console.
  When called with --verbose argument, version information writes to console.

  --help      - displays this output.

  --verbose   - Verbose console output.

  --test      - run internal tests to demonstrate output with current settings.

  --force     - Ignore cached version information.
  --quiet     - Suppress console output.

  CACHE_PATH  - Path for non-tracked file to store git-describe version.
  OUT_FILE    - Path to writable file that is included in the project's rc file.

  Version information is expected to be in the format:
  [v]Major.Minor.Micro[.Revision]-Commits-Hash[-dirty]

  Example pre-build event:
  CALL GIT-VS-VERSION-GEN.bat "$(SolutionDir)" "$(SolutionDir)src\gitversion.h"

Notes
-----
Generated definitions:
  - GIT_HEAD_DESCRIBE
    Terminated string of the git-describe output for HEAD.

  - GIT_DIGITAL_VERSION
    16 bit int values representing Major, Minor, Mirco, Revision.

  - GIT_VERSION_HEX
    Concatenated hex representation of padded Major, Minor, Mirco, Revision.

  - GIT_COMMENT_STRING
    Git tag message value with pre-release stage info appended.

  - GIT_PRIVATE_FLAG
  - GIT_PRIVATE_STRING
    When HEAD is dirty flag is set. String is set to 'Private Build'.

  - GIT_PATCHED_FLAG
    Set when there are commits between the tag and the commit being built.

  - GIT_SPECIAL_FLAG
    Set for maintenance releases when the tag Revision number is higher than 0.

  - GIT_PRERELEASE_FLAG
    Set when the tag includes 'alpha', 'beta' or 'rc'.

Executing the script with the --test argument will generate an example
repository with tagged commits from an alpha stage to next full version
release along with a few maintenance patches and examples of building from
non-tagged commits and then output the data in comma separated format.

About

MS Visual Studio header generator for VERSIONINFO from git-describe during pre-build event.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Batchfile 100.0%