Show git version numbers - Windows

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(corrected a syntactical oopsie)
(updated to work with current tagging info)
Line 1: Line 1:
 
Two components are required to use this process.  
 
Two components are required to use this process.  
  
NOTE:  revtag.sh Updated October 03.2009
+
NOTE:  revtag.sh Updated May, 13, 2010
  
 
'''1.''' The Batch File as presented  
 
'''1.''' The Batch File as presented  
Line 8: Line 8:
  
 
Special Thanks to SMXY (shaun) @ OSGrid for the pointing me in the right direction with the shell script.  
 
Special Thanks to SMXY (shaun) @ OSGrid for the pointing me in the right direction with the shell script.  
 +
 +
More Special Thanks to Armin Wetherhax of teh Imprudence team, helping to resolve the new tagging system to correct the SH script.
 +
 +
 
  
 
<br>'''Usage:'''  
 
<br>'''Usage:'''  
Line 18: Line 22:
  
 
'''The Batch File:'''&nbsp; GIT_Ver.bat<br>
 
'''The Batch File:'''&nbsp; GIT_Ver.bat<br>
<blockquote><br>echo off<br>::<br>:: FILENAME: GIT_Ver.bat<br>:: AUTHOR: WhiteStar Magic @ OSGrid<br>:: DATE: October.15.2009<br>:: REVISION: 0.2 (2nd release) corrected string info<br>::<br>:: DESCRIPTION: <br>:: - GENERATES Git# &amp; Revision Stamp for Opensim.<br>:: - creates the .version file in the /bin directory<br>:: - EXAMPLE: f42d085 - r10727 2009-09-16 15:06:08 -0700<br>::<br>:: INSTALLATION:<br>:: - place this on your desktop for easy access<br>:: - ensure that you have the CORRECT LOCATION defined in the OS_GIT_REPO variable below.<br>::&nbsp;!!! Example Structure as I use it. <br>:: C:\OpenSim_GIT &lt;--- Top Directory where the SH file is created<br>:: C:\OpenSim_GIT\bin &lt;--- where the bin directory is located<br>::&nbsp;!!! This must run from the ONE directory above where \bin is located&nbsp;!!!<br>::<br>:: - CREATE A TEXT FILE called revtag.sh in your OS_GIT_REPO<br>:: -- Place this following line EXACTLY into it.<br>:: echo `git log -n 1 --decorate --oneline | sed -e 's/,.*$//' -e 's,(r/,- r,'` &gt; bin/.version<br>::<br>:: DEPENDENCIES:<br>:: - Installation of GIT TOOLS Windows Installation as per http://opensimulator.org/wiki/Using_Git<br>::&nbsp;!! I installed these two packages as recomended and used the default installations for them<br>:: - http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe<br>:: - http://code.google.com/p/tortoisegit/<br>::<br>:: ==== SET YOUR GIT REPO HERE ====<br>set OS_GIT_REPO=c:\OpenSim_GIT<br>:: ================================<br>:: Appending Path to access all binaries used by GIT<br>::<br>&nbsp;PATH = C:\Program Files\Git\bin;%PATH%;&nbsp;<br>echo&nbsp;%PATH%<br>::<br>echo ON<br>cd&nbsp;%OS_GIT_REPO%<br>::<br>sh.exe revtag.sh </blockquote>
+
<blockquote><br>echo off<br>::<br>:: FILENAME: GIT_Ver.bat<br>:: AUTHOR: WhiteStar Magic @ OSGrid<br>:: DATE: October.15.2009<br>:: REVISION: 0.2 (2nd release) corrected string info<br>::<br>:: DESCRIPTION: <br>:: - GENERATES Git# &amp; Revision Stamp for Opensim.<br>:: - creates the .version file in the /bin directory<br>:: - EXAMPLE: f42d085 - r10727 2009-09-16 15:06:08 -0700<br>::<br>:: INSTALLATION:<br>:: - place this on your desktop for easy access<br>:: - ensure that you have the CORRECT LOCATION defined in the OS_GIT_REPO variable below.<br>::&nbsp;!!! Example Structure as I use it. <br>:: C:\OpenSim_GIT &lt;--- Top Directory where the SH file is created<br>:: C:\OpenSim_GIT\bin &lt;--- where the bin directory is located<br>::&nbsp;!!! This must run from the ONE directory above where \bin is located&nbsp;!!!<br>::<br>:: - CREATE A TEXT FILE called revtag.sh in your OS_GIT_REPO<br>:: -- Place this following line EXACTLY into it.<br>:: echo 'git log -n 1 --decorate --oneline |sed -e's/ (HEAD, /-/' -e 's/,.*$//' -e 's,(r/,- r,' &gt;bin.version<br></blockquote><blockquote>::</blockquote><blockquote>:: DEPENDENCIES:<br>:: - Installation of GIT TOOLS Windows Installation as per http://opensimulator.org/wiki/Using_Git<br>::&nbsp;!! I installed these two packages as recomended and used the default installations for them<br>:: - http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe<br>:: - http://code.google.com/p/tortoisegit/<br>::<br>:: ==== SET YOUR GIT REPO HERE ====<br>set OS_GIT_REPO=c:\OpenSim_GIT<br>:: ================================<br>:: Appending Path to access all binaries used by GIT<br>::<br>&nbsp;PATH = C:\Program Files\Git\bin;%PATH%;&nbsp;<br>echo&nbsp;%PATH%<br>::<br>echo ON<br>cd&nbsp;%OS_GIT_REPO%<br>::<br>sh.exe revtag.sh </blockquote>
 
<br>'''The Shell Script:'''&nbsp; revtag.sh  
 
<br>'''The Shell Script:'''&nbsp; revtag.sh  
<blockquote>echo `git log -n 1 --decorate --oneline | sed -e 's/,.*$//' -e 's,(r/,- r,'` &gt; bin/.version <br></blockquote>
+
<blockquote>echo 'git log -n 1 --decorate --oneline |sed -e's/ (HEAD, /-/' -e 's/,.*$//' -e 's,(r/,- r,' &gt;bin/.version</blockquote>
<br>--[[User:WhiteStar|WhiteStar]] 19:10, 15 October 2009 (UTC)
+
<br>--[[User:WhiteStar|WhiteStar]] 18:44, 13 May 2010 (UTC)

Revision as of 10:44, 13 May 2010

Two components are required to use this process.

NOTE:  revtag.sh Updated May, 13, 2010

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.

More Special Thanks to Armin Wetherhax of teh Imprudence team, helping to resolve the new tagging system to correct the SH 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: October.15.2009
:: REVISION: 0.2 (2nd release) corrected string info
::
:: 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 log -n 1 --decorate --oneline |sed -e's/ (HEAD, /-/' -e 's/,.*$//' -e 's,(r/,- r,' >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 log -n 1 --decorate --oneline |sed -e's/ (HEAD, /-/' -e 's/,.*$//' -e 's,(r/,- r,' >bin/.version


--WhiteStar 18:44, 13 May 2010 (UTC)

Personal tools
General
About This Wiki