Is it possible to store approved pull requests in Stash as userid, and not displayname of the user

Somes users prefer to configure their .gitconfig name to be that of a username vs full name, so when the commit is stored it is that of the username. When a Stash Pull request is commited, it is stored on the git repo as the Last, Name (based on ldap pulled/populated information i assume).

So if a person would run reports on the on 'git log' results, it would show both usernames and "Last, Name" entries, which could be the same person. Basically the logic of the report would have to do lookups to match users.

1 answer

1 accepted

1 vote
Accepted answer

Hi Dana,

Stash uses the 'display name' and the email address as configured in your user directory (LDAP in your case) as the committer of the pull request merge commit. There is no setting in Stash to override this behavior, but there is a way to map both versions of the name to the same canonical name.

You can create a .mailmap file in the root of your repository and map the username to the display name (or vice versa). If there is a .mailmap file on your default branch (typically master, but configurable in repository settings), Stash will use it and display the mapped names. On the command-line, you can use the --use-mailmap flag to get git log to do the same.

git log --use-mailmap

Documentation on how to set up a .mailmap file can be found in the git shortlog man page.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

655 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you