Trigger creation of commit-issue reference links

The context

I’m experimenting with a git repository that is migrating from Bitbucket to Gitlab.
The original commit messages contain references to Jira issues (also migrated to Gitlab).

Since I do have the mapping of Jira-Gitlab issues, and the new repo is not in use yet, I can easily and safely rewrite the original commit messages to convert issue references from Jira to Gitlab.

For example, with a mapping like:


I can rewrite all the commit messages with the awesome git filter-repo:

git filter-repo --force --replace-message issue_mappings.txt

This works perfectly.

The problem

  • If I do this on a checkout and then (force) push the changes, Gitlab correctly shows that the issue and the commit are linked. However, all references to commits that are visible from an issue are:
    • from the user who made the push
    • with the timestamp of the push.
  • That was not acceptable. I naively though: hey, let’s avoid the push. Instead, I applied the rewrite directly on the bare repository managed by Gilab (local installation). The rewrite worked, but when I looked in Gitlab no link between issues and commit was found.

From the above, I concluded that the link is probably created by a post-push hook (initially I was hoping it would be found dynamically, but of course that would not be scalable).

The question

Is there a way to force Gitlab to re-scan the repository and create the missing reference links after I follow the second approach (which does not trigger the hook)?