Show git version numbers - Windows

From OpenSimulator

Revision as of 08:42, 17 September 2009 by WhiteStar (Talk | contribs)

Jump to: navigation, search

Two components are required to use this process.

1. The Batch File as presented

2. The revtag.sh shell script

Special Thanks to SMXY (shaun) @ OSGrid for the pointing me in the right direction with the shell script.


Usage:

Copy the batch file to your desktop and edit the pathing to match your system.

Copy the revtag.sh into the git reposity as commented in the batch file.  NOTE! is you perform a git clean this revtag.sh will be removed form the folder structure therefore you will have to copy it back in, I suggest you have a copy of it handy somewhere.


The Batch File:  GIT_Ver.bat


echo off
::
:: FILENAME: GIT_Ver.bat
:: AUTHOR: WhiteStar Magic @ OSGrid
:: DATE: September.13.2009
:: REVISION: 0.1 (initial release)
::
:: DESCRIPTION:
:: - GENERATES Git# & Revision Stamp for Opensim.
:: - creates the .version file in the /bin directory
:: - EXAMPLE: f42d085 - r10727 2009-09-16 15:06:08 -0700
::
:: INSTALLATION:
:: - place this on your desktop for easy access
:: - ensure that you have the CORRECT LOCATION defined in the OS_GIT_REPO variable below.
:: !!! Example Structure as I use it.
:: C:\OpenSim_GIT <--- Top Directory where the SH file is created
:: C:\OpenSim_GIT\bin <--- where the bin directory is located
:: !!! This must run from the ONE directory above where \bin is located !!!
::
:: - CREATE A TEXT FILE called revtag.sh in your OS_GIT_REPO
:: -- Place this following line EXACTLY into it.
:: echo `git show-ref --tags | tail -1 | sed -e 's,^\(.......\).*/,\1 - r,'` `git log -n 1 --pretty='format:%ci'` > bin/.version
::
:: DEPENDENCIES:
:: - Installation of GIT TOOLS Windows Installation as per http://opensimulator.org/wiki/Using_Git
:: !! I installed these two packages as recomended and used the default installations for them
:: - http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe
:: - http://code.google.com/p/tortoisegit/
::
:: ==== SET YOUR GIT REPO HERE ====
set OS_GIT_REPO=c:\OpenSim_GIT
:: ================================
:: Appending Path to access all binaries used by GIT
::
 PATH = C:\Program Files\Git\bin;%PATH%; 
echo %PATH%
::
echo ON
cd %OS_GIT_REPO%
::
sh.exe revtag.sh


The Shell Script:  revtag.sh

echo `git show-ref --tags | tail -1 | sed -e 's,^\(.......\).*/,\1 - r,'` `git log -n 1 --pretty='format:%ci'` > bin/.version


--WhiteStar 16:42, 17 September 2009 (UTC)

Personal tools
General
About This Wiki