[Tool/Web/Other] samp-git-hash || Generate an include with the most recent Git hash.
#1

About:
This is a simple C program that fetches the git hash of the directory it is executed in and generates an include for Pawn from said git hash so you can include it.
This can be useful when you have frequent server updates, this way users can report bugs with the hash and you'd be able to go back to the precise revision without having to tag all releases.

Features:
  • Fast execution.
  • Easy to use.
  • Easy to compile.
  • Small size.
What?!:
Some development teams release versions of their server very fast, sometimes multiple times per day.
With this you don't need to keep on defining revisions manually for the revision to appear ingame.
Just include this, and use _INC_GIT_HASH_GIT_HASH wherever you want to mention the current revision.
What you do then is run the executable just before you're going to compile your Pawn code, that way the latest git hash will be the one of HEAD.

Notes:
You only need this script if you use Git with your Pawn project.
Any additional information is available at the GitHub page.

I'm sure that I have committed many C sins, this is the first thing other than "Hello World!" that I have made in C.
If you see something that needs to be improved please point it out or fork it, change it and make a pull request.

Download:
GitHub (including binaries)

packages:
The packages below are available in my personal YUM repository under the name samp-git-hash, you can add the repository to your configuration with the following Shell command.
Code:
curl -o /etc/yum.repos.d/jeroendeneef.repo https://rpm.jeroendeneef.com/jeroendenee...eneef.repo
The repository is specifically made for CentOS 6 and 7 and so are the packages, however I don't see a reason why it wouldn't work on RHEL and derivatives.

Reply
#2

Quote:
Originally Posted by [HLF]Southclaw
View Post
This actually looks really useful, nice work! I might use this in future.
Glad that it can be of use.
Reply
#3

Added a Makefile, this way it should be easier to compile this code.
Reply
#4

New for the following Linux distro's:
  • CentOS 6 (i386, x86_64) - Made .x86_64.rpm, .i686.rpm and .src.rpm RPM packages, once installed the tool can be accessed using samp-git-hash
  • CentOS 7 - Made .x86_64.rpm and .src.rpm RPM packages, once installed the tool can be accessed using samp-git-hash
The aforementioned RPM packages are made available through my brand new YUM repository where I publish programs that I make, and keep obscure packages. This should make it easier and faster to update samp-git-hash installations.
You can add the repository in your configuration using the following shell script.
Code:
curl -o /etc/yum.repos.d/jeroendeneef.repo https://rpm.jeroendeneef.com/jeroendenee...eneef.repo
The packages are called samp-git-hash in the repository.

Packages haven't been built for other package managers, I am taking slow steps at this and want to do this correctly. And personally, I <3 yum

I will look at making RPM packages for older versions, although I am not sure who would even want to use them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)