Git hook to send email notification on repo changes

前端 未结 11 1955
情深已故
情深已故 2020-11-28 01:33

How do I configure the appropriate Git hook to send a summary email whenever a set of changes is pushed to the upstream repository?

11条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 02:18

    Robin Sommer's git-notifier generates also very nice summaries in the following format:

    Subject: [git/git-notifier] master: Adding www target to Makefile. (7dc1f95)
    
    Repository : ssh:///git-notifier
    
    On branch  : master
    
    >---------------------------------------------------------------
    
    commit 7dc1f95c97275618d5bde1aaf6760cd7ff6a6ef7
    Author: Robin Sommer 
    Date:   Sun Dec 19 20:21:38 2010 -0800
    
        Adding www target to Makefile.
    
    >---------------------------------------------------------------
    
     Makefile |    6 ++++++
     1 files changed, 6 insertions(+), 0 deletions(-)
    
    diff --git a/Makefile b/Makefile
    index e184c66..9c9951b 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -5,6 +5,8 @@ VERSION   = 0.1
    
     DISTFILES = git-notifier README COPYING
    
    +WWW = $(HOME)/www/git-notifier
    +
     all:
    
     dist:
    @@ -13,3 +15,7 @@ dist:
        cp $(DISTFILES) git-notifier-$(VERSION)
        tar czvf git-notifier-$(VERSION).tgz git-notifier-$(VERSION)
        rm -rf git-notifier-$(VERSION)
    +
    +www: dist
    +   rst2html.py README >$(WWW)/index.html
    +   cp git-notifier-$(VERSION).tgz $(WWW)
    

提交回复
热议问题