gitmercurialgithubhg-git

HgGit: "invalid-email-address" at GitHub


I started to use HgGit extension for mercurial to have copy of repository at GitHub. Almost everything is working well, but in commits information at GitHub I see invalid-email-address (author) instead of my username. Is there a way to show username correctly in this case?


Solution

  • A username in Mercurial is usually of the form:

    Name <email@domain.com>
    

    Git also is usually set up with a name and an e-mail address for the user.

    You probably need to specify an e-mail address in your username in your Mercurial config so that the username in the commits works correctly on github.

    This username is not required to be the same as your username at any particular website, it's for commit information. If it were required to be the same, how would you ever be able to push changesets done by someone else?

    For example, my bitbucket username is different than my Mercurial username on my commits, and the way I keep my bitbucket username and password out of the bitbucket paths in the repo's hgrc is to use the [auth] section of my user .hgrc/Mercurial.ini:

    [auth]
    bb.prefix = bitbucket.org
    bb.schemes = https
    bb.username = myBBusername
    bb.password = myBBpassword
    

    Putting the password here is optional (you'll be prompted), but there are more secure alternatives for storing it, such as the keyring extension.

    However, it's a bit late to change the username on existing changesets (you'd have to re-write the repo's entire history).