0

We are using git (in Bitbucket), and a colleague sent me a pull request, which I reviewed and merged. When I check blame after that, all the reviewed code is blamed on me, not the colleague that actually wrote it...

Is there a way to blame the person that actually wrote/modified the code for each line, and not the one that just did the git merge? "To blame a person" means using the git blame tool to find out who wrote a piece of code.

E_net4
  • 27,810
  • 13
  • 101
  • 139
ntg
  • 12,950
  • 7
  • 74
  • 95
  • 3
    That shouldn't be the case, unless you changed the code. Did you have to resolve any merge conflicts? – SpoonMeiser Jan 05 '18 at 09:58
  • 1
    No... It might have to do with the settings in Bitbucket and the general setup though, I also asked our admin to check it out, he left saying something about "squashed merging/ committing"(?), and that he ll take a look. Still would be interesting to know what's going on... – ntg Jan 05 '18 at 10:14
  • 2
    So did you use the squash merge? Do you see the author's commits in the history? – max630 Jan 05 '18 at 14:15
  • 1
    Note that a "squash merge" is not a merge at all (I dislike this particular Git terminology): it's an all-new commit that *you* wrote, that just uses the changes supplied by someone else. It's up to whoever / whatever-software creates this all-new commit to set attributions in it. – torek Jan 05 '18 at 16:03
  • The admin fixed it... Apparently, Bitbucket was setting the attributions to whoever does the commit... It has some extra options for the admin (which I am not), button should be there https://i.stack.imgur.com/Adkst.png, for setting the system, one section should be about squash merge Not sure if it was disabled or fixed. – ntg Jan 06 '18 at 11:39
  • Also, thanx for the explanation of what it is, I think i get things better now (I did the reviewing of the pulling and merge from the page Bitbucket provides, no extra software was involved, it offers a button for merging) – ntg Jan 06 '18 at 11:46

1 Answers1

0

Incomplete answer based on the user point of view:

Bitbucket was setting the attributions to whoever does the commit... It has some extra options for the admin (which I am not), button should be there:

i.stack.imgur.com/Adkst.png

One section should be about squash merge. The admin needs to setup this section correctly, so that the person who wrote the code and not the one who did the merging is blamed. Further details are related to torek's comment...

DaveyDaveDave
  • 9,821
  • 11
  • 64
  • 77
ntg
  • 12,950
  • 7
  • 74
  • 95