Using different comitter emails for different projects?

Andrew Bennetts andrew at canonical.com
Wed May 28 08:40:24 BST 2008


Staffan Gimåker wrote:
> Hello list,
> 
> I work on both open source projects and work-related projects from the same 
> machine, and whilst commits on my open source projects should use my regular 
> email, commits on work branches should use my job email instead.
> 
> It was easy enough to edit branch.conf to override the default email setting, 
> but this manual override isn't propagated when I branch. Alas I have to 
> resort to manually editing branch.conf every time I make a branch where I 
> don't want the default -- this is both tedious and error prone.
> 
> Is there a better way? A way to propagate the email setting when branching, 
> perhaps? Or a repository-level configuration that can be made?

This is easy to do.  I have something very like this in my
~/.bazaar/locations.conf:

"""
[/home/andrew/code]
email = Andrew Bennetts <personal address>

[/home/andrew/work]
email = Andrew Bennetts <andrew at canonical.com>
"""

Thus any commits I make to a branch under ~/work is committed with my work
identity, and commits made in my personal hacking space (~/code) aren't.  No
configuration of individual branches is required.

-Andrew.





More information about the bazaar mailing list