Show git version numbers - Linux

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Undo revision 15740 by DaveCoyle (Talk))
m (Robot: Cosmetic changes)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
One component required to use this process.  
+
UPDATED: October.11.2010'''.''' The revtag.sh shell script
  
'''1.''' The revtag.sh shell script
+
2 Methods are presented for resolving GIT Hash Numbers to generate the "'''.version'''" file in the BIN directory so that OpenSImulator can display version info. This aids in providing the version information for filing Mantis Reports and tracking the versions in use on the various simulators.
  
'''Usage:'''
 
  
Copy the revtag.sh into the git reposity, immediately above the bin folder. NOTE! is you perform a git clean this revtag.sh will be removed from the folder structure therefore you will have to copy it back in, I suggest you have a copy of it handy somewhere.&nbsp;&nbsp; The Output will be '''6d3d985 - r11191 '''as an example.<br>
+
== '''Usage:''' ==
  
For Example:
+
Create a revtag.sh in the git reposity, immediately above the bin folder. NOTE! is you perform a git clean this revtag.sh will be removed from the folder structure therefore you will have to copy it back in, I suggest you have a copy of it handy somewhere.
  
/OpenSim_GIT
+
For Example:
  
/OpenSim_GIT/opensim
+
/OpenSim_GIT  
  
/OpenSim_GIT/opensim/bin
+
/OpenSim_GIT/opensim  
  
Place this in '''/OpenSim_GIT/opensim'''
+
/OpenSim_GIT/opensim/bin
  
To run the script use the following command '''bash revtag.sh'''
+
Place this in /OpenSim_GIT/opensim
  
'''The Shell Script:'''&nbsp; revtag.sh  
+
To run the script use the following command: '''bash revtag.sh'''
<blockquote>&nbsp;git log -n 1 --decorate --oneline | sed -e s/,.*$//' -e 's,(r/,- r,'` &gt; bin/.version </blockquote>
+
 
<br>--[[User:WhiteStar|WhiteStar]] 01:54, 22 October 2009 (UTC)
+
== <br />'''The Shell Script: revtag.sh '''<br /> ==
 +
 
 +
=== '''Method-1 '''(shows Git-Hash, Date&amp;Time Stamp of commit) ===
 +
 
 +
Resulting output in /bin/.version&nbsp;&nbsp; '''"04cb782 2010-10-03 10:39:43 -0700"'''
 +
 
 +
Git-Bash Command to place in the revtag.sh&nbsp;  
 +
 
 +
echo `git log -n 1 --pretty="format:%h&nbsp;%ci"` &gt;bin/.version<br />
 +
 
 +
=== '''Method-2 ('''shows Git-Hash, Revision Tag) ===
 +
 
 +
Resulting output in /bin/.version '''"04cb782-r/13617"'''
 +
 
 +
Git-Bash Commands to place in the revtag.sh
 +
 
 +
GitNum=`git log -n 1 --pretty="format:%h-"`<br />RevNum=`git describe --tags`<br />echo $GitNum$RevNum &gt;bin/.version  
 +
 
 +
<br />
 +
 
 +
--[[User:WhiteStar|WhiteStar]] 13:36, 11 October 2010 (UTC)

Latest revision as of 20:12, 3 March 2012

UPDATED: October.11.2010. The revtag.sh shell script

2 Methods are presented for resolving GIT Hash Numbers to generate the ".version" file in the BIN directory so that OpenSImulator can display version info. This aids in providing the version information for filing Mantis Reports and tracking the versions in use on the various simulators.


Contents

[edit] Usage:

Create a revtag.sh in the git reposity, immediately above the bin folder. NOTE! is you perform a git clean this revtag.sh will be removed from the folder structure therefore you will have to copy it back in, I suggest you have a copy of it handy somewhere.

For Example:

/OpenSim_GIT

/OpenSim_GIT/opensim

/OpenSim_GIT/opensim/bin

Place this in /OpenSim_GIT/opensim

To run the script use the following command: bash revtag.sh

[edit]
The Shell Script: revtag.sh

[edit] Method-1 (shows Git-Hash, Date&Time Stamp of commit)

Resulting output in /bin/.version   "04cb782 2010-10-03 10:39:43 -0700"

Git-Bash Command to place in the revtag.sh 

echo `git log -n 1 --pretty="format:%h %ci"` >bin/.version

[edit] Method-2 (shows Git-Hash, Revision Tag)

Resulting output in /bin/.version "04cb782-r/13617"

Git-Bash Commands to place in the revtag.sh

GitNum=`git log -n 1 --pretty="format:%h-"`
RevNum=`git describe --tags`
echo $GitNum$RevNum >bin/.version


--WhiteStar 13:36, 11 October 2010 (UTC)

Personal tools
General
About This Wiki