Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 702
digory doo Avatar asked Aug 30 '16 14:08

digory doo


People also ask

Is it possible for a fast forward merge to have conflicts?

Note that merge conflicts will only occur in the event of a 3-way merge. It's not possible to have conflicting changes in a fast-forward merge.

What happens in a fast forward merge in git?

Fast-forward merges literally move your main branch's tip forward to the end of your feature branch. This keeps all commits created in your feature branch sequential while integrating it neatly back into your main branch.

Does a fast forward merge create a commit?

Note that fast-forward updates do not create a merge commit and therefore there is no way to stop those merges with --no-commit. Thus, if you want to ensure your branch is not changed or updated by the merge command, use --no-ff with --no-commit.

What does fast forward merge means?

Fast forward merge can be performed when there is a direct linear path from the source branch to the target branch. In fast-forward merge, git simply moves the source branch pointer to the target branch pointer without creating an extra merge commit.


1 Answers

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)

like image 166
AnimiVulpis Avatar answered Oct 22 '22 18:10

AnimiVulpis