@@ -0,0 +1,1363 @@
+# -*- coding: utf-8 -*-%0A%0Afrom blinker import signal%0Afrom fabric.api import cd, env, run, local, task%0Afrom .utils import green_alert%0A%0Adef init():%0A    signal('deploy.delta.publishing').connect(publish_git_delta)%0A    signal('deploy.head.publishing').connect(publish_git_head)%0A%0Adef publish_git_delta(sender=None, **kwargs):%0A    delta_log = _get_delta()%0A    if not delta_log:%0A        green_alert('No delta.')%0A        return%0A    green_alert('Get delta:%5Cn%25s' %25 delta_log)%0A    signal('git.delta.publishing').send(None, delta_log=delta_log)%0A%0Adef publish_git_head(sender=None, **kwargs):%0A    head = _get_remote_head()%0A    green_alert('Get head: %5Cn%25s' %25 head)%0A    signal('git.head.publishing').send(None, head=head)%0A%0A%0Adef _get_remote_head():%0A    with cd(env.current_path):%0A        return run(%22git rev-parse --short HEAD%22, quiet=True)%0A%0A%0Adef _get_delta(upstream='upstream', bsd=True):%0A    version = _get_remote_head()%0A    green_alert('Current version: %25s' %25 version)%0A%0A    local('/usr/bin/env git fetch -q %25s' %25 upstream)%0A    #FIXME%0A    return local(%0A        'cd /Users/soasme/space/liwushuo/nasdaq ; '%0A        '/usr/bin/env git log --reverse --pretty=%22%25%25h %25%25s: %25%25b%22 --merges %25s..%25s/master %7C '%0A        '/usr/bin/env sed -%25s %22s/Merge pull request #(%5B0-9%5D+) from (%5B%5E/%5D+)%5C%5C/%5B%5E:%5D+/#%5C%5C1%5C%5C/%5C%5C2/%22' %25 (%0A            version, upstream, 'E' if bsd else 'r'), capture=True).decode('utf8')%0A

Add git plugin.