digory doo
digory doo

Reputation: 2311

Git fast forward merge: Any chance to find the person to blame?

Suppose there is a feature branch 'my-feature'. While I was developing the feature, somebody merged it from 'my-feature' into 'master'. Because it was a fast-forward merge, no commit was made. Some of the changes made by me weren't ready for master yet, and it broke quite a few tests when it was pushed to master. However, since these changes were obviously made by me, I was blamed, not the guy who did the fast-forward merge (whoever that was).

Is there any chance to find out who merged 'my-feature' into 'master' even though it was a fast-forward merge? How can I prevent this from happening in the future?

git reflog apparently only shows what's happening locally. We're using a gitlab server, but I haven't found a way to inspect the reflog of gitlab's repository. Any ideas?

Upvotes: 11

Views: 984

Answers (1)

AnimiVulpis
AnimiVulpis

Reputation: 2726

The only chance I see is to try to find some clues in the gitlab-shell.log

The reflog approach will most probably not work because the reflog is deactivated by default for bare repositories. You can turn it on like specified here.


Edit: It will not work for fast-forward merges, which makes sense because a fast-forward merge does not change the commit objects.

You should try using git log --pretty=full.

It will show the Committer (who committed - not you) as well as the Author (who wrote the changes - you)

Upvotes: 1

Related Questions