views:

41

answers:

6

In my team, some we help each other with the merges. I.e. my code is merged back to trunk by someone else. It seems like the author info not is fully preserved during a merge. When I do annotate (blame) the merger is shown as the author.

Have the merger done something wrong or isn’t the original author preserved in a merge?

+1  A: 

A merge looks like someone checkout out trunk, made a load of changes all at once and then committed back in. Whoever did the final commit after the merge will show as the author. If you are getting people to help with the merge, make sure they do it under the username of the person you wish it to be attributed to.

Having said all that, if someone makes a mistake in the merge then you want the name of the person who 'helped' with the merge if they were the one doing it, surely?

Neil Trodden
A: 

I'm not 100% sure, but I think the answer would be: Yes and No... annotate AFAIK will only show you the author that made the most recent change to that line of code. This, in your case, would be the person who did the merge. If you need to go further, you need to blame on the version before the merge.

Michael Wiles
+1  A: 

The only information on the SVN server is the author of the commit. That's what blame/annotate will use.

So no, the author isn't preserved during this kind of merge. It would require LOTS more information than SVN handles.

jv42
A: 

A merge might change the svn:mergeinfo property. In this case, the authors of the original commits for any given merge can be discovered indirectly.

But this is merely a bandaid - if you want real author tracking through merges, you might need to switch to a tool tool designed for distributed development: something like git, hg, or even darcs.

Justice
A: 

In my opinion the approach that the merge is not done by the orignal author is wrong...but this is a different story.

In Subverison every commit is associated with an author. A merge can only be done in a working copy which belongs to a particular author. In my opinion the information in SVN is correct, cause the guy who merged the code is "responsible" for the merge...so the relationship to his name is correct.

khmarbaise
A: 

If your server does merge tracking and your client tools are version 1.5 or later, this will work:

svn blame --use-merge-history TARGET
D Krueger