~bzr-pqm/bzr/bzr.dev

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
Setting up email
================

.. Description of the various ways to specify to Bazaar your email address for commits.

Why set up an email address with Bazaar?
----------------------------------------

Bazaar stores the specified email address in revisions when they're
created so that people can tell who commited which revisions.  The
email addresses are not verified, therefore they could be bogus, so
you have to trust the people involved in your project.  Additionally,
the email address in a revision gives others a way to contact the
author of a revision for credit and/or blame.  :)

How to set up your email address 
--------------------------------

Bazaar will try to guess an email address based on your username and the
hostname if none is set.  This will probably not be what you want, so three
ways exist to tell Bazaar what email to use:

You can set your email in one of several configuration files.  Like
other configuration values, you can set it in ``bazaar.conf`` as a
general setting.  If you want to override the value for a particular
branch, or set of branches, you can use ``locations.conf``.
``.bzr/branch/branch.conf`` will also work, but will cause all commits
to that branch to use the same email address, even if someone else
does them.

The order of precedence is

 1. If the ``$BZR_EMAIL`` environment variable is set.
 #. If an email is set for your current branch in the ``locations.conf``
    file.
 #. If an email is set four your current branch in the
    ``.bzr/branch/branch.conf`` file.
 #. If an email is set in the ``bazaar.conf`` default configuration file.
 #. If the `$EMAIL` environment variable is set.
 #. Bazaar will try to guess based on your username and the hostname.

To check on what Bazaar thinks your current email is, use the ``whoami``
("who am i?") command::

    % bzr whoami
    Joe Cool <joe@example.com>
    
Setting email via the 'whoami' command
--------------------------------------

You can use the whoami command to set your email globally::

    % bzr whoami 'Joe Cool <joe@example.com>'

or only for the current branch::

    % bzr whoami --branch 'Joe Cool <joe@example.com>'

These modify your global ``bazaar.conf`` or branch ``branch.conf`` file, respectively.

Setting email via default configuration file
--------------------------------------------

To use the default ini file, create the file ``$HOME/.bazaar/bazaar.conf`` (on
Windows this is ``%APPDATA%\bazaar\2.0\bazaar.conf``) and set an email address
as shown below.  Please note that the word DEFAULT is case sensitive, and
must be in upper-case.
::

    [DEFAULT]
    email=Your Name <name@isp.com>


For more information on the ini file format, see ConfiguringBzr.

Setting email on a per-branch basis
-----------------------------------

The second approach is to set email on a branch by branch basis by
using the ``$HOME/.bazaar/locations.conf`` configuration file,
thusly::

    [/some/branch/location]
    email=Your Name <name@other-isp.com>

This will set your email address in the branch at ``/some/branch/location``,
overriding the default specified in the ``bazaar.conf`` above.

Setting email via environment variable
--------------------------------------
The final method Bazaar will use is checking for the ``$BZR_EMAIL``
and ``$EMAIL`` environment variables.  Generally, you would use this
method to override the email in a script context.  If you would like
to set a general default, then please see the ini methods above.

Concerns about spam
-------------------
Some people want to avoid sharing their email address so as not to get
spam.  Bazaar will never disclose your email address, unless you publish
a branch or changeset in a public location.  It's recommended that you
*do* use a real address, so that people can contact you about your work,
but it's not required.  You can use an address which is obfuscated, which
bounces, or which goes through an anti-spam service such as
`spamgourmet.com`.