4
.. Description of the various ways to specify to Bazaar your email address for commits.
5
Description of the various ways to specify to Bazaar your email address for
6
8
Why set up an email address with Bazaar?
7
----------------------------------------
9
========================================
9
10
Bazaar stores the specified email address in revisions when they're
10
11
created so that people can tell who commited which revisions. The
11
12
email addresses are not verified, therefore they could be bogus, so
14
15
author of a revision for credit and/or blame. :)
16
17
How to set up your email address
17
--------------------------------
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
21
ways exist to tell Bazaar what email to use:
31
31
The order of precedence is
33
1. If the ``BZR_EMAIL`` environment variable is set.
33
1. If the ``$BZR_EMAIL`` environment variable is set.
34
34
#. If an email is set for your current branch in the ``locations.conf``
36
36
#. If an email is set four your current branch in the
37
37
``.bzr/branch/branch.conf`` file.
38
38
#. If an email is set in the ``bazaar.conf`` default configuration file.
39
#. If the `EMAIL` environment variable is set.
39
#. If the `$EMAIL` environment variable is set.
40
40
#. Bazaar will try to guess based on your username and the hostname.
42
42
To check on what Bazaar thinks your current email is, use the ``whoami``
46
46
Joe Cool <joe@example.com>
48
48
Setting email via the 'whoami' command
49
--------------------------------------
49
======================================
51
50
You can use the whoami command to set your email globally::
53
% bzr whoami "Joe Cool <joe@example.com>"
52
% bzr whoami 'Joe Cool <joe@example.com>'
55
54
or only for the current branch::
57
% bzr whoami --branch "Joe Cool <joe@example.com>"
56
% bzr whoami --branch 'Joe Cool <joe@example.com>'
59
58
These modify your global ``bazaar.conf`` or branch ``branch.conf`` file, respectively.
61
60
Setting email via default configuration file
62
--------------------------------------------
64
To use the default ini file, create or edit the ``bazaar.conf`` file (in
65
``~/.bazaar/`` on Linix 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.
61
============================================
62
To use the default ini file, create the file ``$HOME/.bazaar/bazaar.conf`` (on
63
Windows this is ``%APPDATA%\bazaar\2.0\bazaar.conf``) and set an email address
64
as shown below. Please note that the word DEFAULT is case sensitive, and
65
must be in upper-case.
71
69
email=Your Name <name@isp.com>
74
For more information on the ini file format, see `Configuration Settings`_ in
75
the Bazaar User Reference.
77
.. _Configuration Settings: ../user-reference/bzr_man.html#configuration-settings
72
For more information on the ini file format, see ConfiguringBzr.
79
74
Setting email on a per-branch basis
80
-----------------------------------
75
===================================
82
77
The second approach is to set email on a branch by branch basis by
83
using the ``locations.conf`` configuration file like this::
78
using the ``$HOME/.bazaar/locations.conf`` configuration file,
85
81
[/some/branch/location]
86
82
email=Your Name <name@other-isp.com>
91
87
Setting email via environment variable
92
88
--------------------------------------
93
The final method Bazaar will use is checking for the ``BZR_EMAIL``
94
and ``EMAIL`` environment variables. Generally, you would use this
89
The final method Bazaar will use is checking for the ``$BZR_EMAIL``
90
and ``$EMAIL`` environment variables. Generally, you would use this
95
91
method to override the email in a script context. If you would like
96
92
to set a general default, then please see the ini methods above.
98
94
Concerns about spam
100
96
Some people want to avoid sharing their email address so as not to get
101
97
spam. Bazaar will never disclose your email address, unless you publish
102
98
a branch or changeset in a public location. It's recommended that you