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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

151 views 6 3
Join discussion

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