Can author email in commit message can be used as an identifier

Guru CP February 18, 2021

 

Hi,

I have a use case where we need to keep track of a user who made a commit. I have couple of questions
1. Does author email in commit message is a reliable way to track users commit or should we use something else?
2. The [no reply](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address) email provided by github does bitbucket has something similar? 
3. What happens if a commit doesn't contain author email? What percentage of user do not use any email id in their commit message.

 

1 comment

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2021

Hi @Guru CP ,


1.
The author email in a commit message is based on the email configured locally by the user that made this commit:

This is reliable as long as users set up their own email in their local Git configuration.
It is possible though that a user configures locally as author email an email other than their own, so it's important to communicate to your team to configure their own email.


2.
Are you using Bitbucket Cloud (https://bitbucket.org/) or Bitbucket Server (self-hosted instance)?

In Bitbucket Cloud, I'm afraid that we don't provide a [no reply] email address.

We also use the commit's email address to associate commits with someone's Bitbucket Cloud account. It is possible though to set up email aliases:

For example, let's say user A has a Bitbucket Cloud account with primary/Atlassian account email email-1@domain.com
If the user makes commits with this email as author, we will map these commits to their account.

If they want to make commits with a different email as author, e.g. email-2@domain.com, then they can add email-2@domain.com as an email alias to their Bitbucket Cloud account. Then, if they make commits locally with author email-2@domain.com and push them to Bitbucket, these commits will be mapped to their Bitbucket user in Bitbucket UI.


3.
If a commit doesn't contain an author email, it does not get mapped to any Bitbucket user in Bitbucket UI. I don't believe that we have statistics on the percentage of commits that don't have an author email.

Kind regards,
Theodora

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events