Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Thu, Aug 23, 2012 at 09:52:53AM +0200, Noel Grandin <noel@peralex.com> wrote:
Is it possible to munge the "From:" address in the gerrit emails
that go to the commit list?

I got kind of used to seeing who did the commit in the "from" column
of my email client, and I miss that :-)

The script to hack is:

/git/libreoffice/core.git/hooks/update at people.freedesktop.org, I'm
attaching a trivial diff that could fix the issue (it sets the committer
of the last commit as From, hopefully that's good enough). Michael,
could you please apply it?

Thanks,

Miklos
--- update.orig 2012-08-23 12:18:20.218346617 +0200
+++ update      2012-08-23 12:21:16.997136580 +0200
@@ -72,6 +72,9 @@
        subject="$repo: $subject"
 fi
 
+# Set from
+from="$(git show -s --pretty="format:%cn <%ce>" $1)"
+
 if expr "$2" : '0*$' >/dev/null
 then
        # new ref
@@ -134,6 +137,6 @@
                        fi
                done
 fi |
-mail -s "$subject" -a "X-Git-Repository: git://anongit.freedesktop.org/git/ooo-build/ooo-build" \
+mail -s "$subject" -r "$from" -a "X-Git-Repository: 
git://anongit.freedesktop.org/git/ooo-build/ooo-build" \
      -a "List-Post: <mailto:libreoffice@lists.freedesktop.org>" $recipients
 exit 0

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.