~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/setting_up_email.txt

  • Committer: Alexander Belchenko
  • Date: 2006-07-30 16:43:12 UTC
  • mto: (1711.2.111 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1906.
  • Revision ID: bialix@ukr.net-20060730164312-b025fd3ff0cee59e
rename  gpl.txt => COPYING.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Configuring email
2
 
=================
 
1
================
 
2
Setting up email
 
3
================
3
4
 
4
 
.. Description of the various ways to specify to Bazaar your email address for commits.
 
5
The various ways that exist to tell Bazaar your email address for
 
6
commits.
5
7
 
6
8
Why set up an email address with Bazaar?
7
 
----------------------------------------
8
 
 
9
 
Bazaar stores the specified email address in revisions when they're
10
 
created so that people can tell who committed which revisions.  The
11
 
email addresses are not verified, therefore they could be bogus, so
12
 
you have to trust the people involved in your project.  Additionally,
13
 
the email address in a revision gives others a way to contact the
14
 
author of a revision for credit and/or blame.  :)
15
 
 
16
 
How to set up your email address
17
 
--------------------------------
18
 
 
 
9
========================================
 
10
Bazaar stores the claimed email address in revisions when they're
 
11
created, so that people can tell who commited which revisions.  Of course,
 
12
people can change the email address claimed, so you have to trust the
 
13
people involved.  Additionally, the email address in a revision gives
 
14
others a way to contact the author of a revision for credit and/or blame.
 
15
:)
 
16
 
 
17
How to setup your email address 
 
18
===============================
19
19
Bazaar will try to guess an email address based on your username and the
20
20
hostname if none is set.  This will probably not be what you want, so three
21
 
ways exist to tell Bazaar what email to use:
 
21
ways exist to tell Bazaar what email to use
22
22
 
23
 
You can set your email in one of several configuration files.  Like
24
 
other configuration values, you can set it in ``bazaar.conf`` as a
25
 
general setting.  If you want to override the value for a particular
26
 
branch, or set of branches, you can use ``locations.conf``.
27
 
``.bzr/branch/branch.conf`` will also work, but will cause all commits
28
 
to that branch to use the same email address, even if someone else
29
 
does them.
 
23
 * You can set your email in the default ini file,
 
24
 * You can set emails per-branch in the branch specific ini file,
 
25
 * Or your email can be set by an environmental variable.
30
26
 
31
27
The order of precedence is
32
28
 
33
 
 1. If the ``BZR_EMAIL`` environment variable is set.
34
 
 #. If an email is set for your current branch in the ``locations.conf``
 
29
 1. If the `$BZREMAIL` env variable is set, use it.
 
30
 2. If an email is set for your current branch in the `locations.conf` ini
35
31
    file.
36
 
 #. If an email is set four your current branch in the
37
 
    ``.bzr/branch/branch.conf`` file.
38
 
 #. If an email is set in the ``bazaar.conf`` default configuration file.
39
 
 #. If the `EMAIL` environment variable is set.
40
 
 #. Bazaar will try to guess based on your username and the hostname.
 
32
 3. If an email is set in the `bazaar.conf` default ini file.
 
33
 4. If the `$EMAIL` env variable is set.
 
34
 5. Bazaar will try to guess based on your username and the hostname.
41
35
 
42
 
To check on what Bazaar thinks your current email is, use the ``whoami``
 
36
To check on what Bazaar thinks your current email is, use the '''whoami'''
43
37
("who am i?") command::
44
38
 
45
39
    % bzr whoami
46
40
    Joe Cool <joe@example.com>
47
 
 
 
41
    
48
42
Setting email via the 'whoami' command
49
 
--------------------------------------
50
 
 
 
43
======================================
51
44
You can use the whoami command to set your email globally::
52
45
 
53
 
    % bzr whoami "Joe Cool <joe@example.com>"
 
46
    % bzr whoami 'Joe Cool <joe@example.com>'
54
47
 
55
48
or only for the current branch::
56
49
 
57
 
    % bzr whoami --branch "Joe Cool <joe@example.com>"
58
 
 
59
 
These modify your global ``bazaar.conf`` or branch ``branch.conf`` file, respectively.
60
 
 
61
 
Setting email via default configuration file
62
 
--------------------------------------------
63
 
 
64
 
To use the default ini file, create or edit the ``bazaar.conf`` file (in
65
 
``~/.bazaar/`` on Unix and in ``%APPDATA%\bazaar\2.0\`` in Windows)
66
 
and set an email address as shown below.  Please note that the word DEFAULT
67
 
is case sensitive, and must be in upper-case.
68
 
::
 
50
    % bzr whoami --branch 'Joe Cool <joe@example.com>'
 
51
 
 
52
These modify your global bazaar.conf or branch branch.conf file, respectively.
 
53
 
 
54
Setting email via default ini file
 
55
==================================
 
56
To use the default ini file, create the file `$HOME/.bazaar/bazaar.conf` (on
 
57
Windows this is `%APPDATA%\bazaar\2.0\bazaar.conf`) and set an email address
 
58
as shown below.  Please note that the word DEFAULT is case sensitive, and
 
59
must be in upper-case.::
69
60
 
70
61
    [DEFAULT]
71
62
    email=Your Name <name@isp.com>
72
63
 
73
64
 
74
 
For more information on the ini file format, see `Configuration Settings`_ in
75
 
the Bazaar User Reference.
76
 
 
77
 
.. _Configuration Settings: ../user-reference/bzr_man.html#configuration-settings
 
65
For more information on the ini file format, see ConfiguringBzr.
78
66
 
79
67
Setting email on a per-branch basis
80
 
-----------------------------------
 
68
===================================
81
69
 
82
 
The second approach is to set email on a branch by branch basis by
83
 
using the ``locations.conf`` configuration file like this::
 
70
The second approach is to set email on a branch by branch basis by using the
 
71
`$HOME/.bazaar/locations.conf` ini file, thusly::
84
72
 
85
73
    [/some/branch/location]
86
74
    email=Your Name <name@other-isp.com>
87
75
 
88
 
This will set your email address in the branch at ``/some/branch/location``,
89
 
overriding the default specified in the ``bazaar.conf`` above.
90
 
 
91
 
Setting email via environment variable
92
 
--------------------------------------
93
 
The final method Bazaar will use is checking for the ``BZR_EMAIL``
94
 
and ``EMAIL`` environment variables.  Generally, you would use this
95
 
method to override the email in a script context.  If you would like
96
 
to set a general default, then please see the ini methods above.
97
 
 
98
 
Concerns about spam
99
 
-------------------
 
76
This will set your email address in the branch at `/some/branch/location`,
 
77
overriding the default specified in the `bazaar.conf` above.
 
78
 
 
79
Setting email via environment
 
80
-----------------------------
 
81
The final method Bazaar will use is checking for the `$BZREMAIL` and
 
82
`$EMAIL` environment variables.  Generally, one would use this method to
 
83
override the email in a script context.  If you would like to set a general
 
84
default, then please see the ini methods above.
 
85
 
 
86
 
 
87
Concerns for spam
 
88
=================
100
89
Some people want to avoid sharing their email address so as not to get
101
90
spam.  Bazaar will never disclose your email address, unless you publish
102
91
a branch or changeset in a public location.  It's recommended that you
103
 
*do* use a real address, so that people can contact you about your work,
 
92
''do'' use a real address, so that people can contact you about your work,
104
93
but it's not required.  You can use an address which is obfuscated, which
105
94
bounces, or which goes through an anti-spam service such as
106
95
`spamgourmet.com`.