[X2Go-Commits] [maintenancescripts] 01/03: git/hooks/update-script._irkerhook.py_: add experimental rebase support.
git-admin at x2go.org
git-admin at x2go.org
Mon May 4 00:48:56 CEST 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository maintenancescripts.
commit 35cfe307bf361f6059c3685058d397fead9ee7e2
Author: Mihai Moldovan <ionic at ionic.de>
Date: Mon May 4 00:45:09 2015 +0200
git/hooks/update-script._irkerhook.py_: add experimental rebase support.
---
git/hooks/update-script._irkerhook.py_ | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/git/hooks/update-script._irkerhook.py_ b/git/hooks/update-script._irkerhook.py_
index 774ee18..18ba5d1 100755
--- a/git/hooks/update-script._irkerhook.py_
+++ b/git/hooks/update-script._irkerhook.py_
@@ -240,6 +240,7 @@ class GitExtractor(GenericExtractor):
# These are git-specific
self.refname = do("git symbolic-ref HEAD 2>/dev/null")
self.revformat = do("git config --get irker.revformat")
+ self.rebase = ''
# The project variable defaults to the name of the repository toplevel.
if not self.project:
bare = do("git config --bool --get core.bare")
@@ -277,7 +278,10 @@ class GitExtractor(GenericExtractor):
if not commit.rev:
commit.rev = commit.commit[:12]
# Extract the meta-information for the commit
- commit.files = do("git diff-tree -r --name-only " + shellquote(commit.commit))
+ if self.rebase == ''
+ commit.files = do("git diff-tree -r --name-only " + shellquote(commit.commit))
+ else
+ commit.files = do("git diff-tree -r --name-only " + shellquote(self.rebase) + ".." + shellquote(commit.commit))
commit.files = " ".join(commit.files.strip().split("\n")[1:])
# Design choice: for git we ship only the first message line, which is
# conventionally supposed to be a summary of the commit. Under
@@ -292,6 +296,9 @@ class GitExtractor(GenericExtractor):
tmp.append ("%(lightgrey)s... message truncated%(reset)s" % self.__dict__)
commit.logmsg = "\n".join(tmp)
+
+ if self.rebase != ''
+ commit.logmsg = "%(cyan)sRebase detected.%(reset)s\nOld ref: " + self.rebase + "\nNew HEAD: " + commit.commit + "\nPlease check the URL for more information.";
# 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
@@ -299,6 +306,8 @@ class GitExtractor(GenericExtractor):
commit.author = commit.mail.split("@")[0]
commit.author_date, commit.commit_date = \
do("git log -1 '--pretty=format:%ai|%ci' " + shellquote(commit.commit)).split("|")
+ if self.rebase != ''
+ commit.commit = self.rebase + ".." + commit.commit
return commit
class SvnExtractor(GenericExtractor):
--
Alioth's /srv/git/code.x2go.org/maintenancescripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git
More information about the x2go-commits
mailing list