Git Version numbering with a centralized workflow -
We are using GIT with a central server, and our code needs to include the version number in the file . The way this is currently done is:
- A new developer does "cluster GIT"
- In his local copy, he makes edits. Committed to call Git / Hook / Pre-Version.sh
version.sh (which is included in the project root) takes a version number from "git description" And stores it in a file.
Although this works, I would like to make sure that the version number is updated, even if a developer forgot to edit its pre-committed hook.
Since there is no working copy in the server, just (pre-post) - no hook works, so I am thinking that there is a way to do this.
/ P>
#! / Bin / bash refname = "$ 1" oldrev = "$ 2" newrev = "$ 3" if [-z "$ refname" -o -z "$ oldrev" -o -z "$ newrev"]; Then echo "usage: $ 0 gt; oldrev & gt; & lt; newrev & gt; & Gt; And 2 exit 1fi if ["$ refname"! = "Ref: / Head / Master"]; 0f if again diff -bq & lt; (Git $ oldrev: VERSION) \ & lt; (Git shows $ newrev: VERSION) & gt; / Dev / null then "$ 0: version unchanged; update rejected" & gt; & Amp; 2 exits 1 fi
Comments
Post a Comment