Commit history filtering by author should allow arbitrary input
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Release notes
Commit history filtering by author now allows searching for arbitrary queries.
Problem to solve
The Author drop down on repository history pages (commit listing pages of any branch) currently:
- Only allows selecting users that are current members of the project
- Arbitrarily the selected user's profile full name text to
git log --author=<value>
via Gitaly - Does not allow free-form searches
This assumes the following things are true, but in practice they may not always be:
- That the user's Git commits are produced using the same name they set on their user profile
- User profile names are often set by external authentication/provision systems which may not match the local author name they have supplied
- That the user never changes their profile or Git configured author name
- Either of these names could change at any time independent of each other
- That the two name sources are precisely matched
- GitLab profile names may carry added information such as titles, emojis, etc. that are not configured in the Git author lines configuration
The limitation expressed in reproducible steps:
- Create a branch in a GitLab repository
- Set your local Git configuration for author to match your GitLab account profile name
- Perform a few commits and push to the branch created above
- Visit Project > Repository > Commits and switch to the branch that was pushed to
- Select your user account under the Author dropdown
- Commits are visible
- Visit your GitLab profile edit page
- Adjust the Full name field, a trivial example could be
Firstname Lastname
toLastname, Firstname
- Save changes
- Do not adjust the local Git configuration to match the new profile name
- Perform the steps (4) and (5) again
- No commits are visible
Proposal
Allow the Author
dropdown widget to pass arbitrary names for author.
The actual backend controller already supports this and it is only the frontend that does not permit it.
For example the query parameter in the filtering URL can directly be adjusted to search arbitrary author names:
https://gitlab.example.com/group/project/-/commits/branch-name?author=**THIS VALUE CAN BE CHANGED MANUALLY**
Advanced search is also an option and free-form searches are supported over the entirety of commit data but it only indexes the default branch.