Issues

Issue #8536 wontfix

Assigning commit's author by bitbucket username

Andrey Rybak
created an issue

There are methods to assign bitbucket user as author of a commit:

  • Alias
  • Adding e-mail, associated with bitbucket account, to commit meta-data via configuring local repo/.hg/hgrc or global $HOME/.hgrc like this:
[ui]
username = John Doe <john-doe@examle.org>

Two questions:

  1. Why either ssh-key or bitbucket http-authorization doesn't give immediate assignment of commit's author?

  2. Can you add assignment via something like this in hgrc (if bitbucket username is johndoe):

[ui]
username = johndoe

or this:

[ui]
username = johndoe@bitbucket.org

The issue is :

  • I don't want to add aliases to new repositories.
  • I want immediate commit's author assignment.
  • I don't want my e-mail stored publicly in raw commit.

Comments (6)

  1. Erik van Zijst staff

    Why either ssh-key or bitbucket http-authorization doesn't give immediate assignment of commit's author?

    I'm not sure I follow. Committer information is embedded in the commit object. It is not set of changed when you push up your changes. Once a commit is made by a person, the user's username entry in their hgrc file gets cast in stone as it were.

    Now later on these commits may be pushed up to Bitbucket or another remote repo. The user doing this may not be the same user that created the commits (often a push contains commits of multiple people).

    Now what we when you push is that we identify you through your ssh key and we record you as the person who pushed the changes. This is the entry that then shows up in your newsfeed and on the repo's overview page.

    However, the pusher and committers can be totally different people and the fact that person X did the push, does not make them the committer of the changes.

    The result is that the commits page still shows the individual authors for each commit, regardless who pushed the changes up.

    Can you add assignment via something like this in hgrc (if bitbucket username is johndoe):

    No.

    The .hg/hgrc file on your local machine does not get synced with Bitbucket (or any remote hg repo for that matter). Nor can you add things to the hgrc file on our servers.

    I don't want to add aliases to new repositories.

    he easiest and most portable thing to do is to just register all the email addresses that you use to commit changes with under your Bitbucket account (just go to the account page and hit email addresses).

    Email addresses uniquely identify you and so any commit that is pushed up after you confirmed your additional email addresses, correctly and immediately gets attributed to you (again, regardless of who pushed them up, or which repo this is on).

    I want immediate commit's author assignment.

    I'm not entirely sure what you mean by this.

    I don't want my e-mail stored publicly in raw commit.

    That's really up to you.

    It is recommended in both Git and Mercurial to use your full name and email address in your commits so other people know who wrote the code. In fact, sites like Bitbucket and GitHub rely on this information to map commits to user accounts (as described above).

    While you could omit your email address from your hgrc file when you commit, it is very uncommon to do so and it would also make it impossible for Bitbucket attribute the commits to your account (unless you then set up custom aliases for the strings that use as committer info).

    Now if you don't want to share your email address with the other people that might end up using your repo, you could maybe consider using a different email address. You can still register that address on your Bitbucket account and get the commits properly linked to your account.

    Hope this clears things up a bit.

  2. Log in to comment