[X2Go-Commits] [maintenancescripts] 04/05: git/hooks/update-script._irkerhook.py_: implement --new parameter to handle new branches/tags more gracefully.
git-admin at x2go.org
git-admin at x2go.org
Wed Jan 1 16:08:42 CET 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository maintenancescripts.
commit 346abe2e7e94efb0ef9dbbfb2fc87a1182b1e7ff
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Jan 1 16:07:40 2020 +0100
git/hooks/update-script._irkerhook.py_: implement --new parameter to handle new branches/tags more gracefully.
---
git/hooks/update-script._irkerhook.py_ | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/git/hooks/update-script._irkerhook.py_ b/git/hooks/update-script._irkerhook.py_
index 58cc679..f2544cd 100755
--- a/git/hooks/update-script._irkerhook.py_
+++ b/git/hooks/update-script._irkerhook.py_
@@ -291,6 +291,7 @@ class GitExtractor(GenericExtractor):
self.refname = do("git symbolic-ref HEAD 2>/dev/null")
self.revformat = do("git config --get irker.revformat")
self.rebase = ''
+ self.new = False
# The project variable defaults to the name of the repository toplevel.
if not self.project:
bare = do("git config --bool --get core.bare")
@@ -355,6 +356,10 @@ class GitExtractor(GenericExtractor):
if self.rebase != '':
commit.logmsg = (u"%(cyan)sRebase detected.%(reset)s\nOld ref: " + self.rebase + "\nNew HEAD: " + commit.commit + "\nPlease check the URL for more information.") % self.__dict__
+ if self.new:
+ ref_type = re.sub(r"^refs/([^/])*/.*", '\1', self.refname)
+ ref_type_dict = { "heads": "branch", "tags": "tag" }
+ commit.logmsg = u"{0}{1}".format((u"%(cyan)sNew " + ref_type_dict.get(ref_type, "unknown target") + " \"" + commit.branch +"\" created.%(reset)s Original commit description follows:\n") % self.__dict__, commit.logmsg)
# This discards the part of the author's address after @.
# Might be be nice to ship the full email address, if not
# for spammers' address harvesters - getting this wrong
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git
More information about the x2go-commits
mailing list