How to add a post-commit mailing on SVN Comments Off
Here is a short mémo on how setting up an automatic emailing when a user commits files on a svn repository
Assuming you use a Ubuntu/Debian-based OS.
- First step : make sure you have a functionnal SVN-repository on the machine
- 2nd step : we’ll need libsvn-notify-perl package :
sudo apt-get install libsvn-notify-perl - You may now have the svnnotify binary in /usr/bin/ or something like this. try
whereis svnnotifyif you don’t know where it is - go to you repository’s directory:
cd /home/myname/svn/project1/ - create a file named post-commit in ./hooks/ and make it executable by www-data
touch ./hooks/post-commit && chown www-data:www-data ./hooks/post-commit && sudo chmod u+x ./hooks/post-commit - Now edit post-commit file and write the following :
#!/bin/sh
REPOS="$1"
REV="$2"
/usr/bin/svnnotify -r "$REV" -C -d -H Alternative \
--alt HTML::ColorDiff -p "$REPOS" -t "to@domain.tld" \
--from 'from @ domain.tld' \
just replace to@domain.tld and from@domain.tld by your correct email adresses (advising that to@domain.tld may be a mailing-list that mail all the people that work on the project) - Additionnaly, you can add this :
--reply-to `cat "/home/myname/etc/svn-authors/myproject/$AUTHOR"`\assuming that you have files that contains the email of each svn-user in the /home/myname/etc/svn-authors/myproject/ directory
E.G : in the etc/svn-authors/myproject/ directory you can
echo -n 'firstName.lastName@domain.tld' > userPseudoforeach of yours svn-users
Good luck !
Tags: devloppement, svn, sysadmin, tips, tool, ubuntuSvn mémo Comments Off
Impossible à trouver sur le web (ou alors google me déteste),
voici un mémo des commandes svn les plus utiles (selon moi)
- Créer un repository:
svnadmin create /path/to/repo - Première importation dans le repository:
svn import /path/to/file/to/be/imported/ file:///path/to/repository/ -m "first import message" - Afficher les fichiers impactés par le commit #123 et le message de commit :
svn log -v -r 123 - Gestion des accès au repository :
- /path/to/repository/conf/svnserve.conf
[general]
anon-access = read/write/none
auth-access = read/write/none
password-db = passwd
realm = my SVN project foo
- /path/to/repository/conf/passwd
user:notencryptedpassword
- /path/to/repository/conf/svnserve.conf
- Commandes usuelles :
- mis à jour de la copie locale des fichiers :
svn up - envoyer des fichiers mis à jour sur le repository :
svn ci file1 file2 fil3 -m "commit message"
- mis à jour de la copie locale des fichiers :
Apparement il est possible d’avoir un tortoise-like sous ubuntu :
$ sudo apt-get install nautilus-script-collection-svn
$ nautilus-script-manager enable Subversion
via : snippets.prendreuncafe.com
et encore plus complet ( mais pas parfait, béta oblige, grosse lenteur du HDD donc de tout le système sur ma machine ): google code : Nautilus SVN
Tags: devloppement, svn, tips, tool





