--- /dev/null
+#--------------------------------------------------------------------
+#to prepare git function
+#version change
+CURTAG = $(shell git rev-parse --abbrev-ref HEAD)
+BRANCH = $(shell echo $(CURTAG) | cut -d '-' -f3)
+RELEASE = $(shell git rev-list --count $(CURTAG) ^tag-$(VERSION))
+VERSION = $(shell echo $(CURTAG) | cut -d'-' -f2)
+NEXTREL = $(shell echo $(RELEASE) + 1 |bc)
+MAILREL = $(shell echo $(VERSION)-$(NEXTREL)-$(BRANCH))
+#--------------------------------------------------------------------
+github :
+ @ (cd pub-mailleur ; git push --tags $@ $(BR):$(BR))
+
+allcom : commit maincom
+
+maincom : clean
+ @ git add . mailleur
+ @ git commit -a
+ @ $(MAKE) -s push
+
+push :
+ git push --tags origin $$BR:$$BR ;
+
+commit : fclean dovers
+ @ ( \
+ cd $(PUB) ; \
+ git add . ; \
+ git commit -a ; \
+ git push --tags origin $$BR:$$BR ; \
+ )
+
+BR = $(shell git branch | sed -e '/^[^*]/d' -e 's/* //')
+#--------------------------------------------------------------------
+gitcheck:
+ @ echo CURTAG=$(CURTAG)
+ @ echo BRANCH=$(BRANCH)
+ @ echo VERSION=$(VERSION)
+ @ echo RELEASE=$(RELEASE)
+
+#--------------------------------------------------------------------
+#to clean directory before a git commit
+fclean : clean
+ @ rm -fr core.*
+ @ rm -fr srcrpm/*
+
+#prepare version and working dirs
+dovers :
+ @ make -s clean
+ @ echo "Updating Version WITH $(BRANCH)"
+ @ ( \
+ echo -e "#define VERSION\t\"$(VERSION)\""; \
+ echo -e "#define RELEASE\t\"$(NEXTREL)\""; \
+ echo -e "#define BRANCH\t\"$(BRANCH)\""; \
+ ) > ./lib/numver.h
+ ( \
+ sed \
+ -e "s/=VERSION/=\"$(VERSION)\"/" \
+ -e "s/=NEXTREL/=\"$(NEXTREL)\"/" \
+ -e "s/=BRANCH/=\"$(BRANCH)\"/" \
+ -e "s/=MAILREL/=\"$(MAILREL)\"/" \
+ ./www/release.in \
+ ) > ./www/release.php
+
+#to check if git find difference
+PUB=mailleurXXXXX
+NEWGIT = $(shell cd mailleur ; git diff --exit-code > /dev/null; echo $$?)
+#--------------------------------------------------------------------