summaryrefslogtreecommitdiffstats
path: root/contrib/hooks/multimail/README.migrate-from-post-receive-email
blob: 1e6a976699aa45b884dcf8b1604d2a343b9f1d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
git-multimail is close to, but not exactly, a plug-in replacement for
the old Git project script contrib/hooks/post-receive-email.  This
document describes the differences and explains how to configure
git-multimail to get behavior closest to that of post-receive-email.

If you are in a hurry
=====================

A script called migrate-mailhook-config is included with
git-multimail.  If you run this script within a Git repository that is
configured to use post-receive-email, it will convert the
configuration settings into the approximate equivalent settings for
git-multimail.  For more information, run

    migrate-mailhook-config --help


Configuration differences
=========================

* The names of the config options for git-multimail are in namespace
  "multimailhook.*" instead of "hooks.*".  (Editorial comment:
  post-receive-email should never have used such a generic top-level
  namespace.)

* In emails about new annotated tags, post-receive-email includes a
  shortlog of all changes since the previous annotated tag.  To get
  this behavior with git-multimail, you need to set
  multimailhook.announceshortlog to true:

      git config multimailhook.announceshortlog true

* multimailhook.commitlist -- This is a new configuration variable.
  Recipients listed here will receive a separate email for each new
  commit.  However, if this variable is *not* set, it defaults to the
  value of multimailhook.mailinglist.  Therefore, if you *don't* want
  the members of multimailhook.mailinglist to receive one email per
  commit, then set this value to the empty string:

      git config multimailhook.commitlist ''

* multimailhook.emailprefix -- If this value is not set, then the
  subjects of generated emails are prefixed with the short name of the
  repository enclosed in square brackets; e.g., "[myrepo]".
  post-receive-email defaults to prefix "[SCM]" if this option is not
  set.  So if you were using the old default and want to retain it
  (for example, to avoid having to change your email filters), set
  this variable explicitly to the old value:

      git config multimailhook.emailprefix "[SCM]"

* The "multimailhook.showrev" configuration option is not supported.
  Its main use is obsoleted by the one-email-per-commit feature of
  git-multimail.


Other differences
=================

This section describes other differences in the behavior of
git-multimail vs. post-receive-email.  For full details, please refer
to the main README file:

* One email per commit.  For each reference change, the script first
  outputs one email summarizing the reference change (including
  one-line summaries of the new commits), then it outputs a separate
  email for each new commit that was introduced, including patches.
  These one-email-per-commit emails go to the addresses listed in
  multimailhook.commitlist.  post-receive-email sends only one email
  for each *reference* that is changed, no matter how many commits
  were added to the reference.

* Better algorithm for detecting new commits.  post-receive-email
  processes one reference change at a time, which causes it to fail to
  describe new commits that were included in multiple branches.  For
  example, if a single push adds the "*" commits in the diagram below,
  then post-receive-email would never include the details of the two
  commits that are common to "master" and "branch" in its
  notifications.

      o---o---o---*---*---*    <-- master
                       \
                        *---*  <-- branch

  git-multimail analyzes all reference modifications to determine
  which commits were not present before the change, therefore avoiding
  that error.

* In reference change emails, git-multimail tells which commits have
  been added to the reference vs. are entirely new to the repository,
  and which commits that have been omitted from the reference
  vs. entirely discarded from the repository.

* The environment in which Git is running can be configured via an
  "Environment" abstraction.

* Built-in support for Gitolite-managed repositories.

* Instead of using full SHA1 object names in emails, git-multimail
  mostly uses abbreviated SHA1s, plus one-line log message summaries
  where appropriate.

* In the schematic diagrams that explain non-fast-forward commits,
  git-multimail shows the names of the branches involved.

* The emails generated by git-multimail include the name of the Git
  repository that was modified; this is convenient for recipients who
  are monitoring multiple repositories.

* git-multimail allows the email "From" addresses to be configured.

* The recipients lists (multimailhook.mailinglist,
  multimailhook.refchangelist, multimailhook.announcelist, and
  multimailhook.commitlist) can be comma-separated values and/or
  multivalued settings in the config file; e.g.,

      [multimailhook]
              mailinglist = mr.brown@example.com, mr.black@example.com
              announcelist = Him <him@example.com>
              announcelist = Jim <jim@example.com>
              announcelist = pop@example.com

  This might make it easier to maintain short recipients lists without
  requiring full-fledged mailing list software.

* By default, git-multimail sets email "Reply-To" headers to reply to
  the pusher (for reference updates) and to the author (for commit
  notifications).  By default, the pusher's email address is
  constructed by appending "multimailhook.emaildomain" to the pusher's
  username.

* The generated emails contain a configurable footer.  By default, it
  lists the name of the administrator who should be contacted to
  unsubscribe from notification emails.

* New option multimailhook.emailmaxlinelength to limit the length of
  lines in the main part of the email body.  The default limit is 500
  characters.

* New option multimailhook.emailstrictutf8 to ensure that the main
  part of the email body is valid UTF-8.  Invalid characters are
  turned into the Unicode replacement character, U+FFFD.  By default
  this option is turned on.

* Written in Python.  Easier to add new features.