Show git version numbers - Windows

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (GIT VERSION WINDOWS moved to Show git version numbers - Windows: Removing gratuitous capitalization. THERE'S NO NEED TO SHOUT.)
Line 1: Line 1:
Two components are required to use this process.
+
Two components are required to use this process.  
  
'''1.''' The Batch File as presented
+
'''1.''' The Batch File as presented  
  
'''2.''' The revtag.sh shell script
+
'''2.''' The revtag.sh shell script  
  
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.  
  
 +
<br>'''Usage:'''
  
'''Usage:'''
+
Copy the batch file to your desktop and edit the pathing to match your system.  
 
+
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.&nbsp; NOTE! is you perform a&nbsp;git clean this revtag.sh will be removed form the folder structure therefore you will have to copy it back in, I&nbsp;suggest you have a copy of it handy somewhere.
+
  
 +
Copy the revtag.sh into the git reposity as commented in the batch file.&nbsp; NOTE! is you perform a&nbsp;git clean this revtag.sh will be removed form the folder structure therefore you will have to copy it back in, I&nbsp;suggest you have a copy of it handy somewhere.
  
 +
<br>
  
 
'''The Batch File:'''&nbsp; GIT_Ver.bat<br>
 
'''The Batch File:'''&nbsp; GIT_Ver.bat<br>
<blockquote>
+
<blockquote><br>echo off<br>::<br>:: FILENAME: GIT_Ver.bat<br>:: AUTHOR: WhiteStar Magic @ OSGrid<br>:: DATE: September.13.2009<br>:: REVISION: 0.1 (initial release)<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 show-ref --tags | tail -1 | sed -e 's,^\(.......\).*/,\1 - r,'` `git log -n 1 --pretty='format:%ci'` &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>
<br>echo off<br>::<br>:: FILENAME: GIT_Ver.bat<br>:: AUTHOR: WhiteStar Magic @ OSGrid<br>:: DATE: September.13.2009<br>:: REVISION: 0.1 (initial release)<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>:: !!! 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>:: !!! This must run from the ONE directory above where \bin is located !!!<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 show-ref --tags | tail -1 | sed -e 's,^\(.......\).*/,\1 - r,'` `git log -n 1 --pretty='format:%ci'` &gt; bin/.version <br>::<br>:: DEPENDENCIES:<br>:: - Installation of GIT TOOLS Windows Installation as per http://opensimulator.org/wiki/Using_Git<br>:: !! 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 %PATH%<br>::<br>echo ON<br>cd %OS_GIT_REPO%<br>::<br>sh.exe revtag.sh
+
<br>'''The Shell Script:'''&nbsp; revtag.sh  
</blockquote>
+
<blockquote>echo `git log -n 1 --decorate --oneline | sed -e 's/,.*$//' -e 's,(r/,- r,'` &gt; bin/.version <br></blockquote>
 
+
<br>--[[User:WhiteStar|WhiteStar]] 16:42, 17 September 2009 (UTC)
 
+
'''The Shell Script:'''&nbsp; revtag.sh
+
<blockquote>
+
echo `git show-ref --tags | tail -1 | sed -e 's,^\(.......\).*/,\1 - r,'` `git log -n 1 --pretty='format:%ci'` &gt; bin/.version <br>
+
</blockquote>
+
 
+
 
+
--[[User:WhiteStar|WhiteStar]] 16:42, 17 September 2009 (UTC)
+

Revision as of 09:19, 3 October 2009

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 log -n 1 --decorate --oneline | sed -e 's/,.*$//' -e 's,(r/,- r,'` > bin/.version


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

Personal tools
General
About This Wiki