Skip to content

Commit does not show up on issue if pushed to fork first

Summary

If you make a commit referring to an issue number, and push it to a fork before pushing it to the repo with the issue, the commit does not appear on the issue.

Steps to reproduce

  1. Have a git repo on GitLab
  2. Fork the repo on GitLab
  3. Clone the repo
  4. Have both GitLab repos as remotes
  5. Create an issue on gitlab under the original git repo
  6. Create a commit referring to the issue number
  7. Push the commit to the fork
  8. Push the commit to the original repo (How one can reproduce the issue - this is very important)

Example Project

Original repo here: LinAGKar/testrepo>

Fork here: testgroup-linagkar/testrepo>

Example issue here: LinAGKar/testrepo#1

LinAGKar/testrepo@d2d65611 was pushed to the original repo first, and LinAGKar/testrepo@68e93a40 was pushed to the fork first. Only LinAGKar/testrepo@d2d65611 appeared on the issue.

What is the current bug behavior?

Commit does not appear on issue.

What is the expected correct behavior?

Commit should appear on issue.

Relevant logs and/or screenshots

linus@raven:~/git> git clone git@gitlab.com:LinAGKar/testrepo.git
Klonar till "testrepo"...
The authenticity of host 'gitlab.com (35.231.145.151)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.com,35.231.145.151' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Tar emot objekt: 100% (3/3), klart.
linus@raven:~/git> cd testrepo/
linus@raven:~/git/testrepo> git remote -v
origin  git@gitlab.com:LinAGKar/testrepo.git (fetch)
origin  git@gitlab.com:LinAGKar/testrepo.git (push)
linus@raven:~/git/testrepo> git remote add fork git@gitlab.com:testgroup-linagkar/testrepo.git
linus@raven:~/git/testrepo> git commit --allow-empty
[master d2d6561]  #1 commit a
linus@raven:~/git/testrepo> git push origin
Räknar objekt: 1, klart.
Skriver objekt: 100% (1/1), 185 bytes | 46.00 KiB/s, klart.
Total 1 (delta 0), reused 0 (delta 0)
To gitlab.com:LinAGKar/testrepo.git
   01fef3c..d2d6561  master -> master
linus@raven:~/git/testrepo> git push fork
Räknar objekt: 1, klart.
Skriver objekt: 100% (1/1), 185 bytes | 61.00 KiB/s, klart.
Total 1 (delta 0), reused 0 (delta 0)
To gitlab.com:testgroup-linagkar/testrepo.git
   01fef3c..d2d6561  master -> master
linus@raven:~/git/testrepo> git log
linus@raven:~/git/testrepo> git commit --allow-empty
[master 68e93a4]  #1 commit b
linus@raven:~/git/testrepo> git push fork
Räknar objekt: 1, klart.
Skriver objekt: 100% (1/1), 185 bytes | 46.00 KiB/s, klart.
Total 1 (delta 0), reused 0 (delta 0)
To gitlab.com:testgroup-linagkar/testrepo.git
   d2d6561..68e93a4  master -> master
linus@raven:~/git/testrepo> git push origin
Räknar objekt: 1, klart.
Skriver objekt: 100% (1/1), 185 bytes | 61.00 KiB/s, klart.
Total 1 (delta 0), reused 0 (delta 0)
To gitlab.com:LinAGKar/testrepo.git
   d2d6561..68e93a4  master -> master

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖