diff --git a/irc/commands/git.py b/irc/commands/git.py index 0c7e9b2..3b00cda 100644 --- a/irc/commands/git.py +++ b/irc/commands/git.py @@ -143,11 +143,17 @@ class Git(BaseCommand): self.connection.reply(self.data, "done; no new changes.") else: changes = re.findall("\s*((.*?)\sfile(.*?)tions?\(-\))", result)[0][0] # find the changes - self.connection.reply(self.data, "done; %s." % changes) + try: + remote = self.exec_shell("git config --get branch.%s.remote" % branch) + url = self.exec_shell("git config --get remote.%s.url" % remote) + self.connection.reply(self.data, "done; %s. [from %s]" % (changes, url)) + except subprocess.CalledProcessError: # something in .git/config is not specified correctly, so we cannot get the remote's url + self.connection.reply(self.data, "done; %s." % changes) def do_status(self): """check whether we have anything to pull""" - self.connection.reply(self.data, "checking remote for updates...") + last = self.exec_shell("git log -n 1 --pretty=\"%ar\"") + self.connection.reply(self.data, "last commit was %s. Checking remote for updates..." % last) result = self.exec_shell("git fetch --dry-run") if not result: self.connection.reply(self.data, "local copy is up-to-date with remote.") diff --git a/irc/rc.py b/irc/rc.py index 33831c1..9f77db2 100644 --- a/irc/rc.py +++ b/irc/rc.py @@ -17,8 +17,7 @@ class RC(object): self.msg = msg self.is_edit = True - # page name of the modified page - # 'M' for minor edit, 'B' for bot edit, 'create' for a user creation log entry... + # flags: 'M' for minor edit, 'B' for bot edit, 'create' for a user creation log entry... try: page, flags, url, user, comment = re.findall("\A\[\[(.*?)\]\]\s(.*?)\s(http://.*?)\s\*\s(.*?)\s\*\s(.*?)\Z", msg)[0] except IndexError: # we're probably missing the http:// part, because it's a log entry, which lacks a url