Merge branch 'next'
Conflicts: Changelog.draft.rst docs/MANUAL.rst Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
188
docs/HACKING.rst
188
docs/HACKING.rst
@ -1,188 +0,0 @@
|
||||
.. -*- coding: utf-8 -*-
|
||||
|
||||
.. _OfflineIMAP: https://github.com/nicolas33/offlineimap
|
||||
|
||||
===================
|
||||
Hacking OfflineIMAP
|
||||
===================
|
||||
|
||||
Welcome to the `OfflineIMAP`_ project. You'll find here all the information you
|
||||
need to start hacking OfflineIMAP. Be aware there are a lot of very usefull tips
|
||||
in the mailing list. You may want to subscribe if you didn't, yet. This is
|
||||
where you'll get help.
|
||||
|
||||
.. contents::
|
||||
.. sectnum::
|
||||
|
||||
|
||||
=================================
|
||||
Git: Branching Model And Workflow
|
||||
=================================
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
In order to involve into OfflineIMAP you need some knowledges about Git and our
|
||||
workflow. Don't be afraid if you don't know much, we would be pleased to help
|
||||
you.
|
||||
|
||||
You can find the API docs autogenerated on http://docs.offlineimap.org.
|
||||
|
||||
Release cycles
|
||||
==============
|
||||
|
||||
We use a classical cycle based workflow:
|
||||
|
||||
1. A stable release is out.
|
||||
|
||||
2. Feature topics are sent, discussed and merged.
|
||||
|
||||
3. When enough work was merged, we start the freeze cycle: the first release
|
||||
candidate is out.
|
||||
|
||||
4. During the freeze cycle, no more features are merged. It's time to test
|
||||
OfflineIMAP. New candidates version are released. The more we are late in -rc
|
||||
releases the less patches are merged but bug fixes.
|
||||
|
||||
5. When we think a release is stable enough, we restart from step 1.
|
||||
|
||||
|
||||
Branching model
|
||||
===============
|
||||
|
||||
The branching model with use in OfflineIMAP is very near from the Git project.
|
||||
We use a topic oriented workflow. A topic may be one or more patches.
|
||||
|
||||
The branches you'll find in the official repository are:
|
||||
|
||||
* gh-pages
|
||||
* master
|
||||
* next
|
||||
* pu
|
||||
* maint
|
||||
|
||||
gh-pages
|
||||
--------
|
||||
|
||||
This comes from a feature offered by Github. We maintain the online home github
|
||||
page using this branch.
|
||||
|
||||
master
|
||||
------
|
||||
|
||||
If you're not sure what branch you should use, this one is for you. This is the
|
||||
mainline. Simple users should use this branch to follow OfflineIMAP's evolution.
|
||||
|
||||
Usually, patches submitted to the mailing list should start off of this branch.
|
||||
|
||||
next
|
||||
----
|
||||
|
||||
Patches recently merged are good candidates for this branch. The content of next
|
||||
is merged into the mainline (master) at release time for both stable and -rc
|
||||
releases.
|
||||
|
||||
When patches are sent to the mailing list, contributors discuss about them. Once
|
||||
done and when patches looks ready for mainline, patches are first merged into
|
||||
next. Advanced users and testers use this branch to test last merged patches
|
||||
before they hit the mainline. This helps not introducing strong breackages
|
||||
directly in master.
|
||||
|
||||
pu
|
||||
--
|
||||
|
||||
pu stands for "proposed updates". If a topic is not ready for master nor next,
|
||||
it may be merged into pu. This branch only help developers to work on someone
|
||||
else topic or an earlier pending topic.
|
||||
|
||||
This branch is **not intended to be checkouted**; never. Even developers don't
|
||||
do that. Due to the way pu is built you can't expect content there to work in
|
||||
any way... unless you clearly want to run into troubles.
|
||||
|
||||
Developers can extract a topic from this branch to work on it. See the following
|
||||
section "Extract a topic from pu" in this documentation.
|
||||
|
||||
maint
|
||||
-----
|
||||
|
||||
This is the maintenance branch. It gets its own releases starting from an old
|
||||
stable release. It helps both users having troubles with last stable releases
|
||||
and users not wanting latest features or so to still benefit from strong bug
|
||||
fixes and security fixes.
|
||||
|
||||
|
||||
Working with Git
|
||||
================
|
||||
|
||||
Extract a topic from pu
|
||||
-----------------------
|
||||
|
||||
pu is built this way::
|
||||
|
||||
git checkout pu
|
||||
git reset --keep next
|
||||
git merge --no-ff -X theirs topic1
|
||||
git merge --no-ff -X theirs topic2
|
||||
git merge --no-ff -X theirs blue
|
||||
git merge --no-ff -X theirs orange
|
||||
...
|
||||
|
||||
As a consequence:
|
||||
|
||||
1. Each topic merged uses a merge commit. A merge commit is a commit having 2
|
||||
ancestors. Actually, Git allows more than 2 parents but we don't use this
|
||||
feature. It's intended.
|
||||
|
||||
2. Paths in pu may mix up multiple versions if all the topics don't use the same
|
||||
base commit. This is very often the case as topics aren't rebased: it guarantees
|
||||
each topic is strictly identical to the last version sent to the mailing list.
|
||||
No surprise.
|
||||
|
||||
|
||||
What you need to extract a particular topic is the sha1 of the tip of that
|
||||
branch (the last commit of the topic). Assume you want the branch of the topic
|
||||
called 'blue'. First, look at the log given by this command::
|
||||
|
||||
git log --reverse --merges --parents origin/next..origin/pu
|
||||
|
||||
With this command you ask for the log:
|
||||
|
||||
* from next to pu
|
||||
* in reverse order (older first)
|
||||
* merge commits only
|
||||
* with the sha1 of the ancestors
|
||||
|
||||
In this list, find the topic you're looking for, basing you search on the lines
|
||||
like::
|
||||
|
||||
Merge branch 'topic/name' into pu
|
||||
|
||||
By convention, it has the form <author_initials>/<brief_title>. When you're at
|
||||
it, pick the topic ancestor sha1. It's always the last sha1 in the line starting
|
||||
by 'commit'. For you to know:
|
||||
|
||||
* the first is the sha1 of the commit you see: the merge commit
|
||||
* the following sha1 is the ancestor of the branch checkouted at merge time
|
||||
(always the previous merged topic or the ancien next in our case)
|
||||
* last is the branch merged
|
||||
|
||||
Giving::
|
||||
|
||||
commit sha1_of_merge_commit sha1_of_ancient_pu sha1_of_topic_blue
|
||||
|
||||
Then, you only have to checkout the topic from there::
|
||||
|
||||
git checkout -b blue sha1_of_topic_blue
|
||||
|
||||
and you're done! You've just created a new branch called "blue" with the blue
|
||||
content. Be aware this topic is almostly not updated against current next
|
||||
branch. ,-)
|
||||
|
||||
|
||||
===
|
||||
API
|
||||
===
|
||||
|
||||
API is documented in the dev-doc-src directory using the sphinx tools (also used
|
||||
for python itself). This is a WIP. Contributions in this area would be very
|
||||
appreciated.
|
112
docs/MANUAL.rst
112
docs/MANUAL.rst
@ -2,17 +2,14 @@
|
||||
OfflineIMAP Manual
|
||||
====================
|
||||
|
||||
.. _OfflineIMAP: http://offlineimap.org
|
||||
|
||||
--------------------------------------------------------
|
||||
Powerful IMAP/Maildir synchronization and reader support
|
||||
--------------------------------------------------------
|
||||
|
||||
:Author: John Goerzen <jgoerzen@complete.org> & contributors
|
||||
:Date: 2011-01-15
|
||||
:Copyright: GPL v2
|
||||
:Manual section: 1
|
||||
|
||||
.. TODO: :Manual group:
|
||||
|
||||
:Date: 2012-02-23
|
||||
|
||||
DESCRIPTION
|
||||
===========
|
||||
@ -43,6 +40,10 @@ Most configuration is done via the configuration file. However, any setting can
|
||||
|
||||
OfflineImap is well suited to be frequently invoked by cron jobs, or can run in daemon mode to periodically check your email (however, it will exit in some error situations).
|
||||
|
||||
The documentation is included in the git repository and can be created by
|
||||
issueing `make dev-doc` in the `doc` folder (python-sphinx required), or it can
|
||||
be viewed online at http://docs.offlineimap.org.
|
||||
|
||||
.. _configuration:
|
||||
|
||||
Configuration
|
||||
@ -66,96 +67,9 @@ Check out the `Use Cases`_ section for some example configurations.
|
||||
OPTIONS
|
||||
=======
|
||||
|
||||
|
||||
-1 Disable most multithreading operations
|
||||
|
||||
Use solely a single-connection sync. This effectively sets the
|
||||
maxsyncaccounts and all maxconnections configuration file variables to 1.
|
||||
|
||||
|
||||
-P profiledir
|
||||
|
||||
Sets OfflineIMAP into profile mode. The program will create profiledir (it
|
||||
must not already exist). As it runs, Python profiling information about each
|
||||
thread is logged into profiledir. Please note: This option is present for
|
||||
debugging and optimization only, and should NOT be used unless you have a
|
||||
specific reason to do so. It will significantly slow program performance, may
|
||||
reduce reliability, and can generate huge amounts of data. You must use the
|
||||
-1 option when you use -P.
|
||||
|
||||
|
||||
-a accountlist
|
||||
|
||||
Overrides the accounts option in the general section of the configuration
|
||||
file. You might use this to exclude certain accounts, or to sync some
|
||||
accounts that you normally prefer not to. Separate the accounts by commas,
|
||||
and use no embedded spaces.
|
||||
|
||||
|
||||
-c configfile
|
||||
|
||||
Specifies a configuration file to use in lieu of the default,
|
||||
``~/.offlineimaprc``.
|
||||
|
||||
|
||||
-d debugtype[,...]
|
||||
|
||||
Enables debugging for OfflineIMAP. This is useful if you are trying to track
|
||||
down a malfunction or figure out what is going on under the hood. I suggest
|
||||
that you use this with -1 to make the results more sensible.
|
||||
|
||||
-d requires one or more debugtypes, separated by commas. These define what
|
||||
exactly will be debugged, and include three options: imap, maildir, and
|
||||
thread. The imap option will enable IMAP protocol stream and parsing
|
||||
debugging. Note that the output may contain passwords, so take care to remove
|
||||
that from the debugging output before sending it to anyone else. The maildir
|
||||
option will enable debugging for certain Maildir operations. And thread will
|
||||
debug the threading model.
|
||||
|
||||
|
||||
-f foldername[,foldername]
|
||||
|
||||
Only sync the specified folders. The foldernames are the untranslated
|
||||
foldernames. This command-line option overrides any folderfilter and
|
||||
folderincludes options in the configuration file.
|
||||
|
||||
|
||||
-k [section:]option=value
|
||||
|
||||
Override configuration file option. If "section" is omitted, it defaults to
|
||||
general. Any underscores "_" in the section name are replaced with spaces:
|
||||
for instance, to override option autorefresh in the "[Account Personal]"
|
||||
section in the config file one would use "-k Account_Personal:autorefresh=30".
|
||||
You may give more than one -k on the command line if you wish.
|
||||
|
||||
|
||||
-l filename
|
||||
|
||||
Enables logging to filename. This will log everything that goes to the screen
|
||||
to the specified file. Additionally, if any debugging is specified with -d,
|
||||
then debug messages will not go to the screen, but instead to the logfile
|
||||
only.
|
||||
|
||||
|
||||
-o Run only once,
|
||||
|
||||
ignoring all autorefresh settings in the configuration file.
|
||||
|
||||
|
||||
-q Run only quick synchronizations.
|
||||
|
||||
Ignore any flag updates on IMAP servers.
|
||||
|
||||
|
||||
-h|--help Show summary of options.
|
||||
|
||||
|
||||
-u interface
|
||||
|
||||
Specifies an alternative user interface module to use. This overrides the
|
||||
default specified in the configuration file. The pre-defined options are
|
||||
listed in the User Interfaces section. The interface name is case insensitive.
|
||||
|
||||
The command line options are described by issueing `offlineimap --help`.
|
||||
Details on their use can be found either in the sample offlineimap.conf file or
|
||||
in the user docs at http://docs.offlineimap.org.
|
||||
|
||||
User Interfaces
|
||||
===============
|
||||
@ -389,6 +303,8 @@ as Man-In-The-Middle attacks which cause you to connect to the wrong
|
||||
server and pretend to be your mail server. DO NOT RELY ON STARTTLS AS A
|
||||
SAFE CONNECTION GUARANTEEING THE AUTHENTICITY OF YOUR IMAP SERVER!
|
||||
|
||||
.. _UNIX signals:
|
||||
|
||||
UNIX Signals
|
||||
============
|
||||
|
||||
@ -528,7 +444,7 @@ and Sent which should keep the same name::
|
||||
|
||||
Synchronizing 2 IMAP accounts to local Maildirs that are "next to each
|
||||
other", so that mutt can work on both. Full email setup described by
|
||||
Thomas Kahle at `http://dev.gentoo.org/~tomka/mail.html`_
|
||||
Thomas Kahle at `<http://dev.gentoo.org/~tomka/mail.html>`_
|
||||
|
||||
offlineimap.conf::
|
||||
|
||||
@ -590,7 +506,7 @@ purposes: Fetching passwords from the gnome-keyring and translating
|
||||
folder names on the server to local foldernames. An example
|
||||
implementation of get_username and get_password showing how to query
|
||||
gnome-keyring is contained in
|
||||
`http://dev.gentoo.org/~tomka/mail-setup.tar.bz2`_ The folderfilter is
|
||||
`<http://dev.gentoo.org/~tomka/mail-setup.tar.bz2>`_ The folderfilter is
|
||||
a lambda term that, well, filters which folders to get. The function
|
||||
`oimaptransfolder_acc2` translates remote folders into local folders
|
||||
with a very simple logic. The `INBOX` folder will have the same name
|
||||
|
@ -9,7 +9,7 @@ RST2HTML=`type rst2html >/dev/null 2>&1 && echo rst2html || echo rst2html.py`
|
||||
RST2MAN=`type rst2man >/dev/null 2>&1 && echo rst2man || echo rst2man.py`
|
||||
SPHINXBUILD = sphinx-build
|
||||
|
||||
all: html dev-doc
|
||||
all: man doc
|
||||
|
||||
html: $(HTML_TARGETS)
|
||||
|
||||
@ -22,12 +22,12 @@ offlineimap.1: MANUAL.rst
|
||||
$(RST2MAN) MANUAL.rst offlineimap.1
|
||||
cp -f offlineimap.1 ..
|
||||
|
||||
dev-doc:
|
||||
$(SPHINXBUILD) -b html -d dev-doc/doctrees dev-doc-src dev-doc/html
|
||||
doc:
|
||||
$(SPHINXBUILD) -b html -d html/doctrees doc-src html
|
||||
|
||||
clean:
|
||||
$(RM) -f $(HTML_TARGETS)
|
||||
$(RM) -f offlineimap.1 ../offlineimap.1
|
||||
$(RM) -rf dev-doc/*
|
||||
$(RM) -rf html/*
|
||||
|
||||
.PHONY: dev-doc
|
||||
.PHONY: clean doc
|
||||
|
@ -1,26 +0,0 @@
|
||||
|
||||
|
||||
Upgrading to 4.0
|
||||
----------------
|
||||
|
||||
If you are upgrading from a version of OfflineIMAP prior to 3.99.12, you will
|
||||
find that you will get errors when OfflineIMAP starts up (relating to
|
||||
ConfigParser or AccountHashGenerator) and the configuration file. This is
|
||||
because the config file format had to change to accommodate new features in 4.0.
|
||||
Fortunately, it's not difficult to adjust it to suit.
|
||||
|
||||
|
||||
First thing you need to do is stop any running OfflineIMAP instance, making sure
|
||||
first that it's synced all your mail. Then, modify your `~/.offlineimaprc` file.
|
||||
You'll need to split up each account section (make sure that it now starts with
|
||||
"Account ") into two Repository sections (one for the local side and another for
|
||||
the remote side.) See the files offlineimap.conf.minimal and offlineimap.conf
|
||||
in the distribution if you need more assistance.
|
||||
|
||||
|
||||
OfflineIMAP's status directory area has also changed. Therefore, you should
|
||||
delete everything in `~/.offlineimap` as well as your local mail folders.
|
||||
|
||||
|
||||
When you start up OfflineIMAP 4.0, it will re-download all your mail from the
|
||||
server and then you can continue using it like normal.
|
@ -1 +0,0 @@
|
||||
../FAQ.rst
|
@ -2,8 +2,10 @@
|
||||
|
||||
.. currentmodule:: offlineimap
|
||||
|
||||
Welcome to :mod:`offlineimaps`'s documentation
|
||||
==============================================
|
||||
.. _API docs:
|
||||
|
||||
:mod:`offlineimap's` API documentation
|
||||
======================================
|
||||
|
||||
Within :mod:`offlineimap`, the classes :class:`OfflineImap` provides the high-level functionality. The rest of the classes should usually not needed to be touched by the user. Email repositories are represented by a :class:`offlineimap.repository.Base.BaseRepository` or derivatives (see :mod:`offlineimap.repository` for details). A folder within a repository is represented by a :class:`offlineimap.folder.Base.BaseFolder` or any derivative from :mod:`offlineimap.folder`.
|
||||
|
@ -203,9 +203,10 @@ How is OfflineIMAP conformance?
|
||||
Can I force OfflineIMAP to sync a folder right now?
|
||||
---------------------------------------------------
|
||||
|
||||
Yes,
|
||||
1) if you use the `Blinkenlights` UI. That UI shows the active accounts
|
||||
as follows::
|
||||
Yes:
|
||||
|
||||
1) if you use the `Blinkenlights` UI. That UI shows the active
|
||||
accounts as follows::
|
||||
|
||||
4: [active] *Control: .
|
||||
3: [ 4:36] personal:
|
||||
@ -216,8 +217,9 @@ as follows::
|
||||
resync that account immediately. This will be ignored if a resync is
|
||||
already in progress for that account.
|
||||
|
||||
2) while in sleep mode, you can also send a SIGUSR1. See the `Signals
|
||||
on UNIX`_ section in the MANUAL for details.
|
||||
2) while in sleep mode, you can also send a SIGUSR1. See the :ref:`UNIX
|
||||
signals` section in the MANUAL for details.
|
||||
|
||||
|
||||
I get a "Mailbox already exists" error
|
||||
--------------------------------------
|
||||
@ -291,14 +293,17 @@ certificates chain) in PEM format. (See the documentation of
|
||||
`ssl.wrap_socket`_'s `certfile` parameter for the gory details.) You can use either openssl or gnutls to create a certificate file in the required format.
|
||||
|
||||
#. via openssl::
|
||||
|
||||
openssl s_client -CApath /etc/ssl/certs -connect ${hostname}:imaps -showcerts \
|
||||
| perl -ne 'print if /BEGIN/../END/; print STDERR if /return/' > $sslcacertfile
|
||||
^D
|
||||
|
||||
|
||||
#. via gnutls::
|
||||
gnutls-cli --print-cert -p imaps ${host} </dev/null | sed -n \
|
||||
| '/^-----BEGIN CERT/,/^-----END CERT/p' > $sslcacertfile
|
||||
|
||||
|
||||
The path `/etc/ssl/certs` is not standardized; your system may store
|
||||
SSL certificates elsewhere. (On some systems it may be in
|
||||
`/usr/local/share/certs/`.)
|
783
docs/doc-src/HACKING.rst
Normal file
783
docs/doc-src/HACKING.rst
Normal file
@ -0,0 +1,783 @@
|
||||
.. -*- coding: utf-8 -*-
|
||||
.. _OfflineIMAP: http://offlineimap.org
|
||||
.. _commits mailing list: http://lists.offlineimap.org/listinfo.cgi/commits-offlineimap.org
|
||||
.. _mailing list: http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project
|
||||
|
||||
Hacking OfflineIMAP
|
||||
===================
|
||||
|
||||
In this section you'll find all the information you need to start
|
||||
hacking `OfflineIMAP`_. Be aware there are a lot of very usefull tips
|
||||
in the mailing list. You may want to subscribe if you didn't,
|
||||
yet. This is where you will get help.
|
||||
|
||||
.. contents:: :depth: 2
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
:ref:`OfflineImap's API <API docs>` documentation is included in the user
|
||||
documentation (next section) and online browsable at
|
||||
`<http://docs.offlineimap.org>`_. It is mostly auto-generated from the
|
||||
source code and is a work in progress. Contributions in this area
|
||||
would be very appreciated.
|
||||
|
||||
Following new commits
|
||||
---------------------
|
||||
|
||||
You can follow upstream commits on
|
||||
- `CIA.vc <http://cia.vc/stats/project/offlineimap>`,
|
||||
- `Ohloh <http://www.ohloh.net/p/offlineimap>`,
|
||||
- `GitHub <https://github.com/spaetz/offlineimap/commits/>`,
|
||||
- or on the `commits mailing list`_.
|
||||
|
||||
|
||||
|
||||
Git: OfflineImap's branching Model And Workflow
|
||||
===============================================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This optional section provides you with information on how we use git
|
||||
branches and do releases. You will need to know very little about git
|
||||
to get started.
|
||||
|
||||
For the impatient, see the :ref:`contribution checklist` below.
|
||||
|
||||
Git Branching model
|
||||
--------------------
|
||||
|
||||
OfflineIMAP uses the following branches:
|
||||
|
||||
* master
|
||||
* next
|
||||
* maint
|
||||
* (pu)
|
||||
* & several topic oriented feature branches. A topic may consist of
|
||||
one or more patches.
|
||||
|
||||
master
|
||||
++++++
|
||||
|
||||
If you're not sure what branch you should use, this one is for you.
|
||||
This is the mainline. Simple users should use this branch to follow
|
||||
OfflineIMAP's evolution.
|
||||
|
||||
Usually, patches submitted to the mailing list should start off of
|
||||
this branch.
|
||||
|
||||
next
|
||||
++++
|
||||
|
||||
Patches recently merged are good candidates for this branch. The content of next
|
||||
is merged into the mainline (master) at release time for both stable and -rc
|
||||
releases.
|
||||
|
||||
When patches are sent to the mailing list, contributors discuss about them. Once
|
||||
done and when patches looks ready for mainline, patches are first merged into
|
||||
next. Advanced users and testers use this branch to test last merged patches
|
||||
before they hit the mainline. This helps not introducing strong breackages
|
||||
directly in master.
|
||||
|
||||
pu
|
||||
+++
|
||||
|
||||
pu stands for "proposed updates". If a topic is not ready for master nor next,
|
||||
it may be merged into pu. This branch only help developers to work on someone
|
||||
else topic or an earlier pending topic.
|
||||
|
||||
This branch is **not intended to be checkouted**; never. Even developers don't
|
||||
do that. Due to the way pu is built you can't expect content there to work in
|
||||
any way... unless you clearly want to run into troubles.
|
||||
|
||||
Developers can extract a topic from this branch to work on it. See the following
|
||||
section "Extract a topic from pu" in this documentation.
|
||||
|
||||
maint
|
||||
+++++
|
||||
|
||||
This is the maintenance branch. It gets its own releases starting from an old
|
||||
stable release. It helps both users having troubles with last stable releases
|
||||
and users not wanting latest features or so to still benefit from strong bug
|
||||
fixes and security fixes.
|
||||
|
||||
Release cycles
|
||||
--------------
|
||||
|
||||
A typical release cycle works like this:
|
||||
|
||||
1. A stable release is out.
|
||||
|
||||
2. Feature topics are sent, discussed and merged.
|
||||
|
||||
3. When enough work was merged, we start the freeze cycle: the first release
|
||||
candidate is out.
|
||||
|
||||
4. During the freeze cycle, no more features are merged. It's time to test
|
||||
OfflineIMAP. New candidates version are released. The more we are late in -rc
|
||||
releases the less patches are merged but bug fixes.
|
||||
|
||||
5. When we think a release is stable enough, we restart from step 1.
|
||||
|
||||
|
||||
.. _contribution checklist:
|
||||
|
||||
|
||||
Contribution Checklist (and a short version for the impatient)
|
||||
===============================================================
|
||||
|
||||
Create commits
|
||||
--------------
|
||||
|
||||
* make commits of logical units
|
||||
* check for unnecessary whitespace with ``git diff --check``
|
||||
before committing
|
||||
* do not check in commented out code or unneeded files
|
||||
* the first line of the commit message should be a short
|
||||
description (50 characters is the soft limit, see DISCUSSION
|
||||
in git-commit(1)), and should skip the full stop
|
||||
* the body should provide a meaningful commit message, which:
|
||||
* uses the imperative, present tense: **change**,
|
||||
not **changed** or **changes**.
|
||||
* includes motivation for the change, and contrasts
|
||||
its implementation with previous behaviour
|
||||
* add a ``Signed-off-by: Your Name <you@example.com>`` line to the
|
||||
commit message (or just use the option `-s` when committing)
|
||||
to confirm that you agree to the **Developer's Certificate of Origin**
|
||||
* make sure that you have tests for the bug you are fixing
|
||||
* make sure that the test suite passes after your commit
|
||||
|
||||
|
||||
Export commits as patches
|
||||
-------------------------
|
||||
|
||||
* use ``git format-patch -M`` to create the patch
|
||||
* do not PGP sign your patch
|
||||
* do not attach your patch, but read in the mail
|
||||
body, unless you cannot teach your mailer to
|
||||
leave the formatting of the patch alone.
|
||||
* be careful doing cut & paste into your mailer, not to
|
||||
corrupt whitespaces.
|
||||
* provide additional information (which is unsuitable for
|
||||
the commit message) between the ``---`` and the diffstat
|
||||
* if you change, add, or remove a command line option or
|
||||
make some other user interface change, the associated
|
||||
documentation should be updated as well.
|
||||
* if your name is not writable in ASCII, make sure that
|
||||
you send off a message in the correct encoding.
|
||||
* send the patch to the `mailing list`_ and the
|
||||
maintainer (nicolas.s-dev@laposte.net) if (and only if)
|
||||
the patch is ready for inclusion. If you use `git-send-email(1)`,
|
||||
please test it first by sending email to yourself.
|
||||
* see below for instructions specific to your mailer
|
||||
|
||||
|
||||
|
||||
Long version
|
||||
------------
|
||||
|
||||
I started reading over the SubmittingPatches document for Git, primarily because
|
||||
I wanted to have a document similar to it for OfflineIMAP to make sure people
|
||||
understand what they are doing when they write `Signed-off-by` line.
|
||||
|
||||
But the patch submission requirements are a lot more relaxed here on the
|
||||
technical/contents front, because the OfflineIMAP is a lot smaller ;-). So here
|
||||
is only the relevant bits.
|
||||
|
||||
Decide what branch to base your work on
|
||||
+++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
In general, always base your work on the oldest branch that your
|
||||
change is relevant to.
|
||||
|
||||
* A bugfix should be based on 'maint' in general. If the bug is not
|
||||
present in 'maint', base it on 'master'. For a bug that's not yet
|
||||
in 'master', find the topic that introduces the regression, and
|
||||
base your work on the tip of the topic.
|
||||
* A new feature should be based on 'master' in general. If the new
|
||||
feature depends on a topic that is in 'pu', but not in 'master',
|
||||
base your work on the tip of that topic.
|
||||
* Corrections and enhancements to a topic not yet in 'master' should
|
||||
be based on the tip of that topic. If the topic has not been merged
|
||||
to 'next', it's alright to add a note to squash minor corrections
|
||||
into the series.
|
||||
* In the exceptional case that a new feature depends on several topics
|
||||
not in 'master', start working on 'next' or 'pu' privately and send
|
||||
out patches for discussion. Before the final merge, you may have to
|
||||
wait until some of the dependent topics graduate to 'master', and
|
||||
rebase your work.
|
||||
|
||||
To find the tip of a topic branch, run ``git log --first-parent
|
||||
master..pu`` and look for the merge commit. The second parent of this
|
||||
commit is the tip of the topic branch.
|
||||
|
||||
Make separate commits for logically separate changes
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
Unless your patch is really trivial, you should not be sending your
|
||||
changes in a single patch. Instead, always make a commit with
|
||||
complete commit message and generate a series of small patches from
|
||||
your repository.
|
||||
|
||||
Describe the technical detail of the change(s).
|
||||
|
||||
If your description starts to get too long, that's a sign that you
|
||||
probably need to split up your commit to finer grained pieces.
|
||||
That being said, patches which plainly describe the things that
|
||||
help reviewers check the patch, and future maintainers understand
|
||||
the code, are the most beautiful patches. Descriptions that summarise
|
||||
the point in the subject well, and describe the motivation for the
|
||||
change, the approach taken by the change, and if relevant how this
|
||||
differs substantially from the prior version, can be found on Usenet
|
||||
archives back into the late 80's. Consider it like good Netiquette,
|
||||
but for code.
|
||||
|
||||
|
||||
Generate your patch using git tools out of your commits
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
git based diff tools (git, Cogito, and StGIT included) generate
|
||||
unidiff which is the preferred format.
|
||||
|
||||
You do not have to be afraid to use -M option to ``git diff`` or
|
||||
``git format-patch``, if your patch involves file renames. The
|
||||
receiving end can handle them just fine.
|
||||
|
||||
Please make sure your patch does not include any extra files
|
||||
which do not belong in a patch submission. Make sure to review
|
||||
your patch after generating it, to ensure accuracy. Before
|
||||
sending out, please make sure it cleanly applies to the "master"
|
||||
branch head. If you are preparing a work based on "next" branch,
|
||||
that is fine, but please mark it as such.
|
||||
|
||||
|
||||
Sending your patches
|
||||
++++++++++++++++++++
|
||||
|
||||
People on the mailing list need to be able to read and
|
||||
comment on the changes you are submitting. It is important for
|
||||
a developer to be able to "quote" your changes, using standard
|
||||
e-mail tools, so that they may comment on specific portions of
|
||||
your code. For this reason, all patches should be submitted
|
||||
"inline". WARNING: Be wary of your MUAs word-wrap
|
||||
corrupting your patch. Do not cut-n-paste your patch; you can
|
||||
lose tabs that way if you are not careful.
|
||||
|
||||
It is a common convention to prefix your subject line with
|
||||
[PATCH]. This lets people easily distinguish patches from other
|
||||
e-mail discussions. Use of additional markers after PATCH and
|
||||
the closing bracket to mark the nature of the patch is also
|
||||
encouraged. E.g. [PATCH/RFC] is often used when the patch is
|
||||
not ready to be applied but it is for discussion, [PATCH v2],
|
||||
[PATCH v3] etc. are often seen when you are sending an update to
|
||||
what you have previously sent.
|
||||
|
||||
``git format-patch`` command follows the best current practice to
|
||||
format the body of an e-mail message. At the beginning of the
|
||||
patch should come your commit message, ending with the
|
||||
Signed-off-by: lines, and a line that consists of three dashes,
|
||||
followed by the diffstat information and the patch itself. If
|
||||
you are forwarding a patch from somebody else, optionally, at
|
||||
the beginning of the e-mail message just before the commit
|
||||
message starts, you can put a "From: " line to name that person.
|
||||
|
||||
You often want to add additional explanation about the patch,
|
||||
other than the commit message itself. Place such "cover letter"
|
||||
material between the three dash lines and the diffstat.
|
||||
|
||||
Do not attach the patch as a MIME attachment, compressed or not.
|
||||
Do not let your e-mail client send quoted-printable. Do not let
|
||||
your e-mail client send format=flowed which would destroy
|
||||
whitespaces in your patches. Many
|
||||
popular e-mail applications will not always transmit a MIME
|
||||
attachment as plain text, making it impossible to comment on
|
||||
your code. A MIME attachment also takes a bit more time to
|
||||
process. This does not decrease the likelihood of your
|
||||
MIME-attached change being accepted, but it makes it more likely
|
||||
that it will be postponed.
|
||||
|
||||
Exception: If your mailer is mangling patches then someone may ask
|
||||
you to re-send them using MIME, that is OK.
|
||||
|
||||
Do not PGP sign your patch, at least for now. Most likely, your
|
||||
maintainer or other people on the list would not have your PGP
|
||||
key and would not bother obtaining it anyway. Your patch is not
|
||||
judged by who you are; a good patch from an unknown origin has a
|
||||
far better chance of being accepted than a patch from a known,
|
||||
respected origin that is done poorly or does incorrect things.
|
||||
|
||||
If you really really really really want to do a PGP signed
|
||||
patch, format it as "multipart/signed", not a text/plain message
|
||||
that starts with '-----BEGIN PGP SIGNED MESSAGE-----'. That is
|
||||
not a text/plain, it's something else.
|
||||
|
||||
Unless your patch is a very trivial and an obviously correct one,
|
||||
first send it with "To:" set to the mailing list, with "cc:" listing
|
||||
people who are involved in the area you are touching (the output from
|
||||
"git blame $path" and "git shortlog --no-merges $path" would help to
|
||||
identify them), to solicit comments and reviews. After the list
|
||||
reached a consensus that it is a good idea to apply the patch, re-send
|
||||
it with "To:" set to the maintainer and optionally "cc:" the list for
|
||||
inclusion. Do not forget to add trailers such as "Acked-by:",
|
||||
"Reviewed-by:" and "Tested-by:" after your "Signed-off-by:" line as
|
||||
necessary.
|
||||
|
||||
|
||||
Sign your work
|
||||
++++++++++++++
|
||||
|
||||
To improve tracking of who did what, we've borrowed the
|
||||
"sign-off" procedure from the Linux kernel project on patches
|
||||
that are being emailed around. Although OfflineIMAP is a lot
|
||||
smaller project it is a good discipline to follow it.
|
||||
|
||||
The sign-off is a simple line at the end of the explanation for
|
||||
the patch, which **certifies that you wrote it or otherwise have
|
||||
the right to pass it on as a open-source patch**. The rules are
|
||||
pretty simple: if you can certify the below:
|
||||
|
||||
**Developer's Certificate of Origin 1.1**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
(a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
(b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
(c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
(d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
|
||||
then you just add a line saying
|
||||
|
||||
Signed-off-by: Random J Developer <random@developer.example.org>
|
||||
|
||||
This line can be automatically added by git if you run the git-commit
|
||||
command with the -s option.
|
||||
|
||||
Notice that you can place your own Signed-off-by: line when
|
||||
forwarding somebody else's patch with the above rules for
|
||||
D-C-O. Indeed you are encouraged to do so. Do not forget to
|
||||
place an in-body "From: " line at the beginning to properly attribute
|
||||
the change to its true author (see above).
|
||||
|
||||
Also notice that a real name is used in the Signed-off-by: line. Please
|
||||
don't hide your real name.
|
||||
|
||||
If you like, you can put extra tags at the end:
|
||||
|
||||
* "Reported-by:" is used to to credit someone who found the bug that
|
||||
the patch attempts to fix.
|
||||
* "Acked-by:" says that the person who is more familiar with the area
|
||||
the patch attempts to modify liked the patch.
|
||||
* "Reviewed-by:", unlike the other tags, can only be offered by the
|
||||
reviewer and means that she is completely satisfied that the patch
|
||||
is ready for application. It is usually offered only after a
|
||||
detailed review.
|
||||
* "Tested-by:" is used to indicate that the person applied the patch
|
||||
and found it to have the desired effect.
|
||||
|
||||
You can also create your own tag or use one that's in common usage
|
||||
such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:".
|
||||
|
||||
An ideal patch flow
|
||||
===================
|
||||
|
||||
Here is an ideal patch flow for this project the current maintainer
|
||||
suggests to the contributors:
|
||||
|
||||
(0) You come up with an itch. You code it up.
|
||||
|
||||
(1) Send it to the list and cc people who may need to know about
|
||||
the change.
|
||||
|
||||
The people who may need to know are the ones whose code you
|
||||
are butchering. These people happen to be the ones who are
|
||||
most likely to be knowledgeable enough to help you, but
|
||||
they have no obligation to help you (i.e. you ask for help,
|
||||
don't demand). ``git log -p -- $area_you_are_modifying`` would
|
||||
help you find out who they are.
|
||||
|
||||
(2) You get comments and suggestions for improvements. You may
|
||||
even get them in a "on top of your change" patch form.
|
||||
|
||||
(3) Polish, refine, and re-send to the list and the people who
|
||||
spend their time to improve your patch. Go back to step (2).
|
||||
|
||||
(4) The list forms consensus that the last round of your patch is
|
||||
good. Send it to the list and cc the maintainer.
|
||||
|
||||
(5) A topic branch is created with the patch and is merged to 'next',
|
||||
and cooked further and eventually graduates to 'master'.
|
||||
|
||||
In any time between the (2)-(3) cycle, the maintainer may pick it up
|
||||
from the list and queue it to 'pu', in order to make it easier for
|
||||
people play with it without having to pick up and apply the patch to
|
||||
their trees themselves.
|
||||
|
||||
Know the status of your patch after submission
|
||||
----------------------------------------------
|
||||
|
||||
* You can use Git itself to find out when your patch is merged in
|
||||
master. ``git pull --rebase`` will automatically skip already-applied
|
||||
patches, and will let you know. This works only if you rebase on top
|
||||
of the branch in which your patch has been merged (i.e. it will not
|
||||
tell you if your patch is merged in pu if you rebase on top of
|
||||
master).
|
||||
|
||||
.. * Read the git mailing list, the maintainer regularly posts messages
|
||||
entitled "What's cooking in git.git" and "What's in git.git" giving
|
||||
the status of various proposed changes.
|
||||
|
||||
MUA specific hints
|
||||
==================
|
||||
|
||||
Some of patches I receive or pick up from the list share common
|
||||
patterns of breakage. Please make sure your MUA is set up
|
||||
properly not to corrupt whitespaces. Here are two common ones
|
||||
I have seen:
|
||||
|
||||
* Empty context lines that do not have _any_ whitespace.
|
||||
|
||||
* Non empty context lines that have one extra whitespace at the
|
||||
beginning.
|
||||
|
||||
One test you could do yourself if your MUA is set up correctly is:
|
||||
|
||||
* Send the patch to yourself, exactly the way you would, except
|
||||
To: and Cc: lines, which would not contain the list and
|
||||
maintainer address.
|
||||
|
||||
* Save that patch to a file in UNIX mailbox format. Call it say
|
||||
a.patch.
|
||||
|
||||
* Try to apply to the tip of the "master" branch from the
|
||||
git.git public repository::
|
||||
|
||||
$ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply
|
||||
$ git checkout test-apply
|
||||
$ git reset --hard
|
||||
$ git am a.patch
|
||||
|
||||
If it does not apply correctly, there can be various reasons.
|
||||
|
||||
* Your patch itself does not apply cleanly. That is _bad_ but
|
||||
does not have much to do with your MUA. Please rebase the
|
||||
patch appropriately.
|
||||
|
||||
* Your MUA corrupted your patch; "am" would complain that
|
||||
the patch does not apply. Look at .git/rebase-apply/ subdirectory and
|
||||
see what 'patch' file contains and check for the common
|
||||
corruption patterns mentioned above.
|
||||
|
||||
* While you are at it, check what are in 'info' and
|
||||
'final-commit' files as well. If what is in 'final-commit' is
|
||||
not exactly what you would want to see in the commit log
|
||||
message, it is very likely that your maintainer would end up
|
||||
hand editing the log message when he applies your patch.
|
||||
Things like "Hi, this is my first patch.\n", if you really
|
||||
want to put in the patch e-mail, should come after the
|
||||
three-dash line that signals the end of the commit message.
|
||||
|
||||
|
||||
Pine
|
||||
----
|
||||
|
||||
(Johannes Schindelin)
|
||||
I don't know how many people still use pine, but for those poor souls it may
|
||||
be good to mention that the quell-flowed-text is needed for recent versions.
|
||||
|
||||
... the "no-strip-whitespace-before-send" option, too. AFAIK it was introduced
|
||||
in 4.60.
|
||||
|
||||
(Linus Torvalds)
|
||||
And 4.58 needs at least this
|
||||
|
||||
::
|
||||
|
||||
---
|
||||
diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1)
|
||||
Author: Linus Torvalds <torvalds@g5.osdl.org>
|
||||
Date: Mon Aug 15 17:23:51 2005 -0700
|
||||
|
||||
Fix pine whitespace-corruption bug
|
||||
|
||||
There's no excuse for unconditionally removing whitespace from
|
||||
the pico buffers on close.
|
||||
|
||||
diff --git a/pico/pico.c b/pico/pico.c
|
||||
--- a/pico/pico.c
|
||||
+++ b/pico/pico.c
|
||||
@@ -219,7 +219,9 @@ PICO *pm;
|
||||
switch(pico_all_done){ /* prepare for/handle final events */
|
||||
case COMP_EXIT : /* already confirmed */
|
||||
packheader();
|
||||
+#if 0
|
||||
stripwhitespace();
|
||||
+#endif
|
||||
c |= COMP_EXIT;
|
||||
break;
|
||||
|
||||
(Daniel Barkalow)
|
||||
> A patch to SubmittingPatches, MUA specific help section for
|
||||
> users of Pine 4.63 would be very much appreciated.
|
||||
|
||||
Ah, it looks like a recent version changed the default behavior to do the
|
||||
right thing, and inverted the sense of the configuration option. (Either
|
||||
that or Gentoo did it.) So you need to set the
|
||||
"no-strip-whitespace-before-send" option, unless the option you have is
|
||||
"strip-whitespace-before-send", in which case you should avoid checking
|
||||
it.
|
||||
|
||||
|
||||
Thunderbird
|
||||
-----------
|
||||
|
||||
(A Large Angry SCM)
|
||||
By default, Thunderbird will both wrap emails as well as flag them as
|
||||
being 'format=flowed', both of which will make the resulting email unusable
|
||||
by git.
|
||||
|
||||
Here are some hints on how to successfully submit patches inline using
|
||||
Thunderbird.
|
||||
|
||||
There are two different approaches. One approach is to configure
|
||||
Thunderbird to not mangle patches. The second approach is to use
|
||||
an external editor to keep Thunderbird from mangling the patches.
|
||||
|
||||
**Approach #1 (configuration):**
|
||||
|
||||
This recipe is current as of Thunderbird 2.0.0.19. Three steps:
|
||||
|
||||
1. Configure your mail server composition as plain text
|
||||
Edit...Account Settings...Composition & Addressing,
|
||||
uncheck 'Compose Messages in HTML'.
|
||||
2. Configure your general composition window to not wrap
|
||||
Edit..Preferences..Composition, wrap plain text messages at 0
|
||||
3. Disable the use of format=flowed
|
||||
Edit..Preferences..Advanced..Config Editor. Search for:
|
||||
mailnews.send_plaintext_flowed
|
||||
toggle it to make sure it is set to 'false'.
|
||||
|
||||
After that is done, you should be able to compose email as you
|
||||
otherwise would (cut + paste, git-format-patch | git-imap-send, etc),
|
||||
and the patches should not be mangled.
|
||||
|
||||
**Approach #2 (external editor):**
|
||||
|
||||
This recipe appears to work with the current [*1*] Thunderbird from Suse.
|
||||
|
||||
The following Thunderbird extensions are needed:
|
||||
AboutConfig 0.5
|
||||
http://aboutconfig.mozdev.org/
|
||||
External Editor 0.7.2
|
||||
http://globs.org/articles.php?lng=en&pg=8
|
||||
|
||||
|
||||
1) Prepare the patch as a text file using your method of choice.
|
||||
|
||||
2) Before opening a compose window, use Edit->Account Settings to
|
||||
uncheck the "Compose messages in HTML format" setting in the
|
||||
"Composition & Addressing" panel of the account to be used to send the
|
||||
patch. [*2*]
|
||||
|
||||
3) In the main Thunderbird window, _before_ you open the compose window
|
||||
for the patch, use Tools->about:config to set the following to the
|
||||
indicated values::
|
||||
|
||||
mailnews.send_plaintext_flowed => false
|
||||
mailnews.wraplength => 0
|
||||
|
||||
4) Open a compose window and click the external editor icon.
|
||||
|
||||
5) In the external editor window, read in the patch file and exit the
|
||||
editor normally.
|
||||
|
||||
6) Back in the compose window: Add whatever other text you wish to the
|
||||
message, complete the addressing and subject fields, and press send.
|
||||
|
||||
7) Optionally, undo the about:config/account settings changes made in
|
||||
steps 2 & 3.
|
||||
|
||||
|
||||
[Footnotes]
|
||||
|
||||
*1* Version 1.0 (20041207) from the MozillaThunderbird-1.0-5 rpm of Suse
|
||||
9.3 professional updates.
|
||||
|
||||
*2* It may be possible to do this with about:config and the following
|
||||
settings but I haven't tried, yet::
|
||||
|
||||
mail.html_compose => false
|
||||
mail.identity.default.compose_html => false
|
||||
mail.identity.id?.compose_html => false
|
||||
|
||||
(Lukas Sandström)
|
||||
There is a script in contrib/thunderbird-patch-inline which can help you
|
||||
include patches with Thunderbird in an easy way. To use it, do the steps above
|
||||
and then use the script as the external editor.
|
||||
|
||||
Gnus
|
||||
----
|
||||
|
||||
'|' in the *Summary* buffer can be used to pipe the current
|
||||
message to an external program, and this is a handy way to drive
|
||||
"git am". However, if the message is MIME encoded, what is
|
||||
piped into the program is the representation you see in your
|
||||
*Article* buffer after unwrapping MIME. This is often not what
|
||||
you would want for two reasons. It tends to screw up non ASCII
|
||||
characters (most notably in people's names), and also
|
||||
whitespaces (fatal in patches). Running 'C-u g' to display the
|
||||
message in raw form before using '|' to run the pipe can work
|
||||
this problem around.
|
||||
|
||||
|
||||
KMail
|
||||
-----
|
||||
|
||||
This should help you to submit patches inline using KMail.
|
||||
|
||||
1) Prepare the patch as a text file.
|
||||
|
||||
2) Click on New Mail.
|
||||
|
||||
3) Go under "Options" in the Composer window and be sure that
|
||||
"Word wrap" is not set.
|
||||
|
||||
4) Use Message -> Insert file... and insert the patch.
|
||||
|
||||
5) Back in the compose window: add whatever other text you wish to the
|
||||
message, complete the addressing and subject fields, and press send.
|
||||
|
||||
|
||||
Gmail
|
||||
-----
|
||||
|
||||
GMail does not appear to have any way to turn off line wrapping in the web
|
||||
interface, so this will mangle any emails that you send. You can however
|
||||
use "git send-email" and send your patches through the GMail SMTP server, or
|
||||
use any IMAP email client to connect to the google IMAP server and forward
|
||||
the emails through that.
|
||||
|
||||
To use ``git send-email`` and send your patches through the GMail SMTP server,
|
||||
edit `~/.gitconfig` to specify your account settings::
|
||||
|
||||
[sendemail]
|
||||
smtpencryption = tls
|
||||
smtpserver = smtp.gmail.com
|
||||
smtpuser = user@gmail.com
|
||||
smtppass = p4ssw0rd
|
||||
smtpserverport = 587
|
||||
|
||||
Once your commits are ready to be sent to the mailing list, run the
|
||||
following commands::
|
||||
|
||||
$ git format-patch --cover-letter -M origin/master -o outgoing/
|
||||
$ edit outgoing/0000-*
|
||||
$ git send-email outgoing/*
|
||||
|
||||
To submit using the IMAP interface, first, edit your `~/.gitconfig` to specify your
|
||||
account settings::
|
||||
|
||||
[imap]
|
||||
folder = "[Gmail]/Drafts"
|
||||
host = imaps://imap.gmail.com
|
||||
user = user@gmail.com
|
||||
pass = p4ssw0rd
|
||||
port = 993
|
||||
sslverify = false
|
||||
|
||||
You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
|
||||
that the "Folder doesn't exist".
|
||||
|
||||
Once your commits are ready to be sent to the mailing list, run the
|
||||
following commands::
|
||||
|
||||
$ git format-patch --cover-letter -M --stdout origin/master | git imap-send
|
||||
|
||||
Just make sure to disable line wrapping in the email client (GMail web
|
||||
interface will line wrap no matter what, so you need to use a real
|
||||
IMAP client).
|
||||
|
||||
Working with Git
|
||||
================
|
||||
|
||||
Extract a topic from pu
|
||||
-----------------------
|
||||
|
||||
pu is built this way::
|
||||
|
||||
git checkout pu
|
||||
git reset --keep next
|
||||
git merge --no-ff -X theirs topic1
|
||||
git merge --no-ff -X theirs topic2
|
||||
git merge --no-ff -X theirs blue
|
||||
git merge --no-ff -X theirs orange
|
||||
...
|
||||
|
||||
As a consequence:
|
||||
|
||||
1. Each topic merged uses a merge commit. A merge commit is a commit having 2
|
||||
ancestors. Actually, Git allows more than 2 parents but we don't use this
|
||||
feature. It's intended.
|
||||
|
||||
2. Paths in pu may mix up multiple versions if all the topics don't use the same
|
||||
base commit. This is very often the case as topics aren't rebased: it guarantees
|
||||
each topic is strictly identical to the last version sent to the mailing list.
|
||||
No surprise.
|
||||
|
||||
|
||||
What you need to extract a particular topic is the sha1 of the tip of that
|
||||
branch (the last commit of the topic). Assume you want the branch of the topic
|
||||
called 'blue'. First, look at the log given by this command::
|
||||
|
||||
git log --reverse --merges --parents origin/next..origin/pu
|
||||
|
||||
With this command you ask for the log:
|
||||
|
||||
* from next to pu
|
||||
* in reverse order (older first)
|
||||
* merge commits only
|
||||
* with the sha1 of the ancestors
|
||||
|
||||
In this list, find the topic you're looking for, basing you search on the lines
|
||||
like::
|
||||
|
||||
Merge branch 'topic/name' into pu
|
||||
|
||||
By convention, it has the form <author_initials>/<brief_title>. When you're at
|
||||
it, pick the topic ancestor sha1. It's always the last sha1 in the line starting
|
||||
by 'commit'. For you to know:
|
||||
|
||||
* the first is the sha1 of the commit you see: the merge commit
|
||||
* the following sha1 is the ancestor of the branch checkouted at merge time
|
||||
(always the previous merged topic or the ancien next in our case)
|
||||
* last is the branch merged
|
||||
|
||||
Giving::
|
||||
|
||||
commit sha1_of_merge_commit sha1_of_ancient_pu sha1_of_topic_blue
|
||||
|
||||
Then, you only have to checkout the topic from there::
|
||||
|
||||
git checkout -b blue sha1_of_topic_blue
|
||||
|
||||
and you're done! You've just created a new branch called "blue" with the blue
|
||||
content. Be aware this topic is almostly not updated against current next
|
||||
branch. ,-)
|
66
docs/doc-src/features.rst
Normal file
66
docs/doc-src/features.rst
Normal file
@ -0,0 +1,66 @@
|
||||
Description
|
||||
===========
|
||||
|
||||
OfflineIMAP is a tool to simplify your e-mail reading. With OfflineIMAP, you can
|
||||
read the same mailbox from multiple computers. You get a current copy of your
|
||||
messages on each computer, and changes you make one place will be visible on all
|
||||
other systems. For instance, you can delete a message on your home computer, and
|
||||
it will appear deleted on your work computer as well. OfflineIMAP is also useful
|
||||
if you want to use a mail reader that does not have IMAP support, has poor IMAP
|
||||
support, or does not provide disconnected operation.
|
||||
|
||||
OfflineIMAP works on pretty much any POSIX operating system, such as Linux, BSD
|
||||
operating systems, MacOS X, Solaris, etc.
|
||||
|
||||
OfflineIMAP is a Free Software project licensed under the GNU General Public
|
||||
License. You can download it for free, and you can modify it. In fact, you are
|
||||
encouraged to contribute to OfflineIMAP, and doing so is fast and easy.
|
||||
|
||||
OfflineIMAP is FAST; it synchronizes my two accounts with over 50 folders in 3
|
||||
seconds. Other similar tools might take over a minute, and achieve a
|
||||
less-reliable result. Some mail readers can take over 10 minutes to do the same
|
||||
thing, and some don't even support it at all. Unlike other mail tools,
|
||||
OfflineIMAP features a multi-threaded synchronization algorithm that can
|
||||
dramatically speed up performance in many situations by synchronizing several
|
||||
different things simultaneously.
|
||||
|
||||
OfflineIMAP is FLEXIBLE; you can customize which folders are synced via regular
|
||||
expressions, lists, or Python expressions; a versatile and comprehensive
|
||||
configuration file is used to control behavior; two user interfaces are
|
||||
built-in; fine-tuning of synchronization performance is possible; internal or
|
||||
external automation is supported; SSL and PREAUTH tunnels are both supported;
|
||||
offline (or "unplugged") reading is supported; and esoteric IMAP features are
|
||||
supported to ensure compatibility with the widest variety of IMAP servers.
|
||||
|
||||
OfflineIMAP is SAFE; it uses an algorithm designed to prevent mail loss at all
|
||||
costs. Because of the design of this algorithm, even programming errors should
|
||||
not result in loss of mail. I am so confident in the algorithm that I use my
|
||||
own personal and work accounts for testing of OfflineIMAP pre-release,
|
||||
development, and beta releases. Of course, legally speaking, OfflineIMAP comes
|
||||
with no warranty, so I am not responsible if this turns out to be wrong.
|
||||
|
||||
.. note: OfflineImap was written by John Goerzen, who retired from
|
||||
maintaining. It is now maintained by Nicolas Sebrecht & Sebastian
|
||||
Spaeth at https://github.com/spaetz/offlineimap. Thanks to John
|
||||
for his great job and to have share this project with us.
|
||||
|
||||
Method of Operation
|
||||
===================
|
||||
|
||||
OfflineIMAP traditionally operates by maintaining a hierarchy of mail folders in
|
||||
Maildir format locally. Your own mail reader will read mail from this tree, and
|
||||
need never know that the mail comes from IMAP. OfflineIMAP will detect changes
|
||||
to the mail folders on your IMAP server and your own computer and
|
||||
bi-directionally synchronize them, copying, marking, and deleting messages as
|
||||
necessary.
|
||||
|
||||
With OfflineIMAP 4.0, a powerful new ability has been introduced ― the program
|
||||
can now synchronize two IMAP servers with each other, with no need to have a
|
||||
Maildir layer in-between. Many people use this if they use a mail reader on
|
||||
their local machine that does not support Maildirs. People may install an IMAP
|
||||
server on their local machine, and point both OfflineIMAP and their mail reader
|
||||
of choice at it. This is often preferable to the mail reader's own IMAP support
|
||||
since OfflineIMAP supports many features (offline reading, for one) that most
|
||||
IMAP-aware readers don't. However, this feature is not as time-tested as
|
||||
traditional syncing, so my advice is to stick with normal methods of operation
|
||||
for the time being.
|
@ -15,6 +15,7 @@ If you just want to get started with minimal fuzz, have a look at our `online qu
|
||||
More information on specific topics can be found on the following pages:
|
||||
|
||||
**User documentation**
|
||||
* :doc:`Overview and features <features>`
|
||||
* :doc:`installation/uninstall <INSTALL>`
|
||||
* :doc:`user manual/Configuration <MANUAL>`
|
||||
* :doc:`Folder filtering & name transformation guide <nametrans>`
|
||||
@ -22,18 +23,21 @@ More information on specific topics can be found on the following pages:
|
||||
* :doc:`Frequently Asked Questions <FAQ>`
|
||||
|
||||
**Developer documentation**
|
||||
* :doc:`HACKING HowTo & git workflows <HACKING>`
|
||||
* :doc:`API documentation <API>` for internal details on the
|
||||
:mod:`offlineimap` module
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
features
|
||||
INSTALL
|
||||
MANUAL
|
||||
nametrans
|
||||
offlineimap
|
||||
FAQ
|
||||
|
||||
HACKING
|
||||
API
|
||||
repository
|
||||
ui
|
184
docs/doc-src/nametrans.rst
Normal file
184
docs/doc-src/nametrans.rst
Normal file
@ -0,0 +1,184 @@
|
||||
.. _folder_filtering_and_name_translation:
|
||||
|
||||
Folder filtering and Name translation
|
||||
=====================================
|
||||
|
||||
OfflineImap provides advanced and potentially complex possibilities for
|
||||
filtering and translating folder names. If you don't need any of this, you can
|
||||
safely skip this section.
|
||||
|
||||
.. warning::
|
||||
Starting with v6.4.0, OfflineImap supports the creation of folders on the remote repostory. This change means that people that only had a nametrans option on the remote repository (everyone) will need to have a nametrans setting on the local repository too that will reverse the name transformation. See section `Reverse nametrans`_ for details.
|
||||
|
||||
folderfilter
|
||||
------------
|
||||
|
||||
If you do not want to synchronize all your filters, you can specify a `folderfilter`_ function that determines which folders to include in a sync and which to exclude. Typically, you would set a folderfilter option on the remote repository only, and it would be a lambda or any other python function.
|
||||
|
||||
The only parameter to that function is the folder name. If the filter
|
||||
function returns True, the folder will be synced, if it returns False,
|
||||
it. will be skipped. The folderfilter operates on the *UNTRANSLATED*
|
||||
name (before any `nametrans`_ fudging takes place). Consider the
|
||||
examples below to get an idea of what they do.
|
||||
|
||||
Example 1: synchronizing only INBOX and Sent::
|
||||
|
||||
folderfilter = lambda folder: folder in ['INBOX', 'Sent']
|
||||
|
||||
Example 2: synchronizing everything except Trash::
|
||||
|
||||
folderfilter = lambda folder: folder not in ['Trash']
|
||||
|
||||
Example 3: Using a regular expression to exclude Trash and all folders
|
||||
containing the characters "Del"::
|
||||
|
||||
folderfilter = lambda folder: not re.search('(^Trash$|Del)', folder)
|
||||
|
||||
.. note::
|
||||
If folderfilter is not specified, ALL remote folders will be
|
||||
synchronized.
|
||||
|
||||
You can span multiple lines by indenting the others. (Use backslashes
|
||||
at the end when required by Python syntax) For instance::
|
||||
|
||||
folderfilter = lambda foldername: foldername in
|
||||
['INBOX', 'Sent Mail', 'Deleted Items',
|
||||
'Received']
|
||||
|
||||
Usually it suffices to put a `folderfilter`_ setting in the remote repository section. You might want to put a folderfilter option on the local repository if you want to prevent some folders on the local repository to be created on the remote one. (Even in this case, folder filters on the remote repository will prevent that)
|
||||
|
||||
folderincludes
|
||||
--------------
|
||||
|
||||
You can specify `folderincludes`_ to manually include additional folders to be synced, even if they had been filtered out by a folderfilter setting. `folderincludes`_ should return a Python list.
|
||||
|
||||
This can be used to 1) add a folder that was excluded by your
|
||||
folderfilter rule, 2) to include a folder that your server does not specify
|
||||
with its LIST option, or 3) to include a folder that is outside your basic
|
||||
`reference`. The `reference` value will not be prefixed to this folder
|
||||
name, even if you have specified one. For example::
|
||||
|
||||
folderincludes = ['debian.user', 'debian.personal']
|
||||
|
||||
This will add the "debian.user" and "debian.personal" folders even if you
|
||||
have filtered out everything starting with "debian" in your folderfilter
|
||||
settings.
|
||||
|
||||
|
||||
nametrans
|
||||
----------
|
||||
|
||||
Sometimes, folders need to have different names on the remote and the
|
||||
local repositories. To achieve this you can specify a folder name
|
||||
translator. This must be a eval-able Python expression that takes a
|
||||
foldername arg and returns the new value. We suggest a lambda function,
|
||||
but it could be any python function really. If you use nametrans rules, you will need to set them both on the remote and the local repository, see `Reverse nametrans`_ just below for details. The following examples are thought to be put in the remote repository section.
|
||||
|
||||
The below will remove "INBOX." from the leading edge of folders (great
|
||||
for Courier IMAP users)::
|
||||
|
||||
nametrans = lambda folder: re.sub('^INBOX\.', '', folder)
|
||||
|
||||
Using Courier remotely and want to duplicate its mailbox naming
|
||||
locally? Try this::
|
||||
|
||||
nametrans = lambda folder: re.sub('^INBOX\.*', '.', folder)
|
||||
|
||||
.. warning::
|
||||
You MUST construct nametrans rules such that it NEVER returns the
|
||||
same value for two folders, UNLESS the second values are filtered
|
||||
out by folderfilter below. That is, two filters on one side may
|
||||
never point to the same folder on the other side. Failure to follow
|
||||
this rule will result in undefined behavior. See also *Sharing a
|
||||
maildir with multiple IMAP servers* in the :ref:`pitfalls` section.
|
||||
|
||||
|
||||
Reverse nametrans
|
||||
+++++++++++++++++
|
||||
|
||||
Since 6.4.0, OfflineImap supports the creation of folders on the remote repository and that complicates things. Previously, only one nametrans setting on the remote repository was needed and that transformed a remote to a local name. However, nametrans transformations are one-way, and OfflineImap has no way using those rules on the remote repository to back local names to remote names.
|
||||
|
||||
Take a remote nametrans rule `lambda f: re.sub('^INBOX/','',f)` which cuts of any existing INBOX prefix. Now, if we parse a list of local folders, finding e.g. a folder "Sent", is it supposed to map to "INBOX/Sent" or to "Sent"? We have no way of knowing. This is why **every nametrans setting on a remote repository requires an equivalent nametrans rule on the local repository that reverses the transformation**.
|
||||
|
||||
Take the above examples. If your remote nametrans setting was::
|
||||
|
||||
nametrans = lambda folder: re.sub('^INBOX\.', '', folder)
|
||||
|
||||
then you will want to have this in your local repository, prepending "INBOX" to any local folder name::
|
||||
|
||||
nametrans = lambda folder: 'INBOX' + folder
|
||||
|
||||
Failure to set the local nametrans rule will lead to weird-looking error messages of -for instance- this type::
|
||||
|
||||
ERROR: Creating folder moo.foo on repository remote
|
||||
Folder 'moo.foo'[remote] could not be created. Server responded: ('NO', ['Unknown namespace.'])
|
||||
|
||||
(This indicates that you attempted to create a folder "Sent" when all remote folders needed to be under the prefix of "INBOX.").
|
||||
|
||||
OfflineImap will make some sanity checks if it needs to create a new
|
||||
folder on the remote side and a back-and-forth nametrans-lation does not
|
||||
yield the original foldername (as that could potentially lead to
|
||||
infinite folder creation cycles).
|
||||
|
||||
You can probably already see now that creating nametrans rules can be a pretty daunting and complex endeavour. Check out the Use cases in the manual. If you have some interesting use cases that we can present as examples here, please let us know.
|
||||
|
||||
Debugging folderfilter and nametrans
|
||||
------------------------------------
|
||||
|
||||
Given the complexity of the functions and regexes involved, it is easy to misconfigure things. One way to test your configuration without danger to corrupt anything or to create unwanted folders is to invoke offlineimap with the `--info` option.
|
||||
|
||||
It will output a list of folders and their transformations on the screen (save them to a file with -l info.log), and will help you to tweak your rules as well as to understand your configuration. It also provides good output for bug reporting.
|
||||
|
||||
FAQ on nametrans
|
||||
----------------
|
||||
|
||||
Where to put nametrans rules, on the remote and/or local repository?
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
If you never intend to create new folders on the LOCAL repository that
|
||||
need to be synced to the REMOTE repository, it is sufficient to create a
|
||||
nametrans rule on the remote Repository section. This will be used to
|
||||
determine the names of new folder names on the LOCAL repository, and to
|
||||
match existing folders that correspond.
|
||||
|
||||
*IF* you create folders on the local repository, that are supposed to be
|
||||
automatically created on the remote repository, you will need to create
|
||||
a nametrans rule that provides the reverse name translation.
|
||||
|
||||
(A nametrans rule provides only a one-way translation of names and in
|
||||
order to know which names folders on the LOCAL side would have on the
|
||||
REMOTE side, you need to specify the reverse nametrans rule on the local
|
||||
repository)
|
||||
|
||||
OfflineImap will complain if it needs to create a new folder on the
|
||||
remote side and a back-and-forth nametrans-lation does not yield the
|
||||
original foldername (as that could potentially lead to infinite folder
|
||||
creation cycles).
|
||||
|
||||
What folder separators do I need to use in nametrans rules?
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
**Q:** If I sync from an IMAP server with folder separator '/' to a
|
||||
Maildir using the default folder separator '.' which do I need to use
|
||||
in nametrans rules?::
|
||||
|
||||
nametrans = lambda f: "INBOX/" + f
|
||||
|
||||
or::
|
||||
nametrans = lambda f: "INBOX." + f
|
||||
|
||||
**A:** Generally use the folder separator as defined in the repository
|
||||
you write the nametrans rule for. That is, use '/' in the above
|
||||
case. We will pass in the untranslated name of the IMAP folder as
|
||||
parameter (here `f`). The translated name will ultimately have all
|
||||
folder separators be replaced with the destination repositories'
|
||||
folder separator.
|
||||
|
||||
So if 'f' was "Sent", the first nametrans yields the translated name
|
||||
"INBOX/Sent" to be used on the other side. As that repository uses the
|
||||
folder separator '.' rather than '/', the ultimate name to be used will
|
||||
be "INBOX.Sent".
|
||||
|
||||
(As a final note, the smart will see that both variants of the above
|
||||
nametrans rule would have worked identically in this case)
|
||||
|
@ -6,6 +6,15 @@ Offlineimap is invoked with the following pattern: `offlineimap [args...]`.
|
||||
Where [args...] are as follows:
|
||||
|
||||
Options:
|
||||
--dry-run This mode protects us from performing any actual action.
|
||||
It will not precisely give the exact information what
|
||||
will happen. If e.g. it would need to create a folder,
|
||||
it merely outputs "Would create folder X", but not how
|
||||
many and which mails it would transfer.
|
||||
--info Output information on the configured email
|
||||
repositories. Useful for debugging and bug reporting.
|
||||
Use in conjunction with the -a option to limit the
|
||||
output to a single account.
|
||||
--version show program's version number and exit
|
||||
-h, --help show this help message and exit
|
||||
-1 Disable all multithreading operations and use solely a
|
Reference in New Issue
Block a user