2014-09-18 03:43:40 +02:00
|
|
|
# Developing Qpsmtpd
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
## Mailing List
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
All qpsmtpd development happens on the qpsmtpd mailing list.
|
|
|
|
|
|
|
|
Subscribe by sending mail to qpsmtpd-subscribe@perl.org
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
## Git
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
We use git for version control.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
The master repository is at git://github.com/smtpd/qpsmtpd.git
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
We suggest using github to host your repository -- it makes your
|
|
|
|
changes easily accessible for pulling into the master. After you
|
|
|
|
create a github account, go to
|
2014-09-18 03:43:40 +02:00
|
|
|
[the master repository](http://github.com/smtpd/qpsmtpd/tree/master) and click on the "fork"
|
2009-02-12 09:20:06 +01:00
|
|
|
button to get your own repository.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Making a working Copy
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git clone git@github.com:username/qpsmtpd.git qpsmtpd
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
will check out your copy into a directory called qpsmtpd
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Making a branch for your change
|
2009-02-12 10:21:20 +01:00
|
|
|
|
|
|
|
As a general rule, you'll be better off if you do your changes on a
|
|
|
|
branch - preferably a branch per unrelated change.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
You can use the `git branch` command to see which branch you are on.
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
The easiest way to make a new branch is
|
2009-06-03 01:30:20 +02:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git checkout -b topic/my-great-change
|
2009-02-12 10:21:20 +01:00
|
|
|
|
|
|
|
This will create a new branch with the name "topic/my-great-change"
|
|
|
|
(and your current commit as the starting point).
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Committing a change
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
Edit the appropriate files, and be sure to run the test suite.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
emacs lib/Qpsmtpd.pm # for example
|
|
|
|
perl Makefile.PL
|
|
|
|
make test
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
When you're ready to check it in...
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git add lib/Qpsmtpd.pm # to let git know you changed the file
|
|
|
|
git add --patch plugin/tls # interactive choose which changes to add
|
|
|
|
git diff --cached # review changes added
|
|
|
|
git commit # describe the commit
|
|
|
|
git log -p # review your commit a last time
|
|
|
|
git push origin # to send to github
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Commit Descriptions
|
2010-05-11 05:36:54 +02:00
|
|
|
|
|
|
|
Though not required, it's a good idea to begin the commit message with
|
|
|
|
a single short (less than 50 character) line summarizing the change,
|
|
|
|
followed by a blank line and then a more thorough description. Tools
|
|
|
|
that turn commits into email, for example, use the first line on the
|
|
|
|
Subject: line and the rest of the commit in the body.
|
2014-09-18 03:43:40 +02:00
|
|
|
(From: [git-commit(1)](http://man.he.net/man1/git-commit))
|
2010-05-11 05:36:54 +02:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Submit patches by mail
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2009-02-27 10:04:11 +01:00
|
|
|
The best way to submit patches to the project is to send them to the
|
2014-09-18 03:43:40 +02:00
|
|
|
mailing list for review. Use the `git format-patch` command to
|
2009-02-27 10:04:11 +01:00
|
|
|
generate patches ready to be mailed. For example:
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git format-patch HEAD~3
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2009-02-27 10:04:11 +01:00
|
|
|
will put each of the last three changes in files ready to be mailed
|
2014-09-18 03:43:40 +02:00
|
|
|
with the `git send-email` tool (it might be a good idea to send them
|
2009-02-27 10:04:11 +01:00
|
|
|
to yourself first as a test).
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2009-02-27 10:04:11 +01:00
|
|
|
Sending patches to the mailing list is the most effective way to
|
|
|
|
submit changes, although it helps if you at the same time also commit
|
|
|
|
them to a git repository (for example on github).
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Merging changes back in from the master repository
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2012-04-08 02:33:36 +02:00
|
|
|
Tell git about the master repository. We're going to call it 'smtpd'
|
2009-02-12 09:20:06 +01:00
|
|
|
for now, but you could call it anything you want. You only have to do
|
|
|
|
this once.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git remote add smtpd git://github.com/smtpd/qpsmtpd.git
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
Pull in data from all remote branches
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git remote update
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
Forward-port local commits to the updated upstream head
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git rebase smtpd/master
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
If you have a change that conflicts with an upstream change (git will
|
2014-09-18 03:43:40 +02:00
|
|
|
let you know) you have two options.
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
Manually fix the conflict and then do
|
2009-02-12 10:21:20 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git add some/file
|
|
|
|
git commit
|
2009-06-03 01:30:20 +02:00
|
|
|
|
2009-02-12 10:21:20 +01:00
|
|
|
Or if the conflicting upstream commit did the same logical change then
|
|
|
|
you might want to just skip the local change:
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git rebase --skip
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
Be sure to decide whether you're going to skip before you merge, or
|
|
|
|
you might get yourself into an odd situation.
|
|
|
|
|
|
|
|
Conflicts happen because upstream committers may make minor tweaks to
|
|
|
|
your change before applying it.
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Throwing away changes
|
2009-02-12 09:20:06 +01:00
|
|
|
|
|
|
|
If you get your working copy into a state you don't like, you can
|
|
|
|
always revert to the last commit:
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git reset --hard HEAD
|
2009-02-12 10:21:20 +01:00
|
|
|
|
|
|
|
Or throw away your most recent commit:
|
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
git reset --hard HEAD^
|
2009-02-12 10:21:20 +01:00
|
|
|
|
|
|
|
If you make a mistake with this, git is pretty good about keeping your
|
|
|
|
commits around even as you merge, rebase and reset away. This log of
|
|
|
|
your git changes is called with "git reflog".
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2014-09-18 03:43:40 +02:00
|
|
|
### Applying other peoples changes
|
2009-02-12 09:20:06 +01:00
|
|
|
|
2009-02-12 10:21:20 +01:00
|
|
|
If you get a change in an email with the patch, one easy way to apply
|
2014-09-18 03:43:40 +02:00
|
|
|
other peoples changes is to use `git am`. That will go ahead and
|
|
|
|
commit the change. To modify it, you can use `git commit --amend`.
|
2009-02-12 10:21:20 +01:00
|
|
|
|
|
|
|
If the changes are in a repository, you can add that repository with
|
|
|
|
"git remote add" and then either merge them in with "git merge" or
|
|
|
|
pick just the relevant commits with "git cherry-pick".
|