Highlighting of a new line in diffs
I think it will be more consistent to highlight (with a darker color) all added characters, even on lines which are all new. See the picture:
http://s15.postimg.org/uln6ryq17/diff.png
Otherwise it is more difficult to distinguish what was really changed. Especially for longer lines.
We are happy to announce that this feature has been completed on BL791
-
Anonymous commented
Come on! It can't be so difficult to make an option to allow this.
-
Anonymous commented
Please do this optional at least.
-
JakubH commented
A colleague of mine has run into a very similar issue recently (similar to the one I described in the last comment). There was a big block deleted in destination in which only several lines were added in source. It is almost impossible to quickly find which lines were added in source without cumbersome copying code to an external diffing app.
Can you comment on this? -
JakubH commented
I have a nice example, why is the highlighting of a new line important. See this screenshot: http://s27.postimg.org/7z0bbz67n/what_was_changed_in_source.png and now say, what has been changed in the source. The solution is that only a line with "void CalcNamedGroups();" has been added, but it is very hard to see. Simple diff (https://plasticscm.uservoice.com/forums/15467-general/suggestions/4341536-simple-diffs-in-a-merge-tool) would be helpful here too but highlighting of the added line would be enough.
-
JakubH commented
I will try to explain it more deeply.
I completely understand it is good to highlight changed characters within the line.
However, when a new line was added, all characters of that line are new. To be consistent, they should be highlighted too.I would like to point out that consecutive lines are perceived as one block. It is very confusing when some of the new characters in that block are highlighted and some are not. It is clear from my picture I think.
Another problem with your approach appears on long lines. User must inspect the whole line (even scrolling might be necessary) to find out if it is a completely new line or whether there is only a minor change somewhere in it. You are saying that highlighting the whole line bring no additional info. Yeah, that information can be obtained without it, but not directly. User needs to make sure there is no highlighted character on that line to know that he/she should interpret the color on that line differently – all those characters are new actually.
Furthermore, I don't understand why you think that characters on a completely new line should get less attention than new characters on an existing line.
Maybe you want to check out the Araxis Merge, which is very good in an intuitive visualization of changes.
-
Borja commented
Hi JakubH,
The highlighted characters, or words, are the changed ones inside a changed (replaced) line. They are highlighted in order to center the attention on the changes that have been done inside the line. If they were not highlighted the user would have to search for the changes that have been done inside that line; that could be a hard work, for example on a long line with a single character changed.
On the other hand, in an added line, all the line is changed (as there is no previous content) so all the line would be highlighted. For that reason, on an added line the highlight would not give any additional info to the user. Even more, the attention focused for the highlighted characters on the replaced line is reduced when the following added lines are fully highlighted.
Summarizing, we don't see the advantage of this change. Maybe you could explain what advantages do you see in your suggestion to us, so that we try to find a better approach.
-
Adminpsantosl (Admin, plasticscm) commented
Hi JakubH, I think this is an interesting point. I'll check with Dani, who is the guy behind most of the diffs! :-)