Umherirrender
Willkommen auf meiner Diskussionsseite.
Falls du Fragen oder Anregungen/Kritik hast, dann hinterlasse mir eine Nachricht.
Archiv |
Wie wird ein Archiv angelegt? |
Diff: Improve in 2011
Die nachstehend skizzierte Entwicklung wurde im April 2011 angestoßen vom Umherirrenden. Sie ist mit Ende Mai 2011 umgezogen nach Mediawiki und wird dort weitergeführt. Ich hatte gehofft, dass das seltsame Geschehen auf dieser Disku, die vielleicht von Techies mitgelesen und gelegentlich aufgesucht wird, Mitstreiter anlocken würde. Weiterhin sind Anregungen, Kommentare und Mitarbeit willkommen. --PerfektesChaos 09:24, 30. Mai 2011 (CEST)
|
The current standard diff suffers from some limitations. The implementation can be improved a bit without major decrease in performance. A million of users world wide should not be flabbergasted by an entirely new appearance. The basic algorithm (line based diff engine) is quite fast and should be kept. However, preparing the input and displaying the results might be enhanced.
Six improvements are suggested.
It is expected that performance is not impaired. Suggested code is longer, but saves a lot of work from existing and untouched diff engine, e.g. by hiding empty lines. Showing the differences in a better way should pay off even some slight additional resources.
Avoid confusion by empty lines
Objective: If an “empty line” (maybe with some invisible content) has been inserted or removed by the author and the adjacent paragraphs are modified in some way, the presentation of the result is currently disturbed.
Example:
previous line | previous line |
small modification | |
change little | |
minor modification | |
change slighty | |
following line | following line |
Could be presented as:
previous line | previous line |
small modification | minor modification |
change little | change slighty |
following line | following line |
Improve modified consecutive lines
Objective: The line based algorithm makes minor corrections in consecutive lines appear as a dramatic change.
Example:
previous line | small modification …whaffle… …blah… | …Blah… …Whaffle… change little | following line | |
previous line | minor modification …whaffle… …blah… | added line | …Blah… …Whaffle… change slighty | following line |
results currently in:
previous line | previous line |
small modification …whaffle… …blah… |
|
…Blah… …Whaffle… change little |
|
minor modification …whaffle… …blah… | |
added line | |
…Blah… …Whaffle… change slighty | |
following line | following line |
This shall be made more readable:
previous line | previous line |
small modification …whaffle… …blah… |
minor modification …whaffle… …blah… |
added line | |
…Blah… …Whaffle… change little |
…Blah… …Whaffle… change slighty |
following line | following line |
Improve visualization of context lines
Objectives: Currently any kind of line is displayed when two lines preceding or following shall give an impression of the unchanged context where a changed block is located.
- If one or both of these lines are empty they are put into HTML source but invisible and not informative.
- If these lines are very long (sometimes each 1000 bytes and more), both paragraphs are displayed anyway, making the output lengthy and hard to survey.
The suggested code has a slightly different behaviour:
- The most adjacent non-empty (visible) lines will be shown.
- Not two paragraphs but the next unchanged two virtual lines (each expected of at least 100 bytes if not full paragraph) will be displayed.
Visualize space-only differences
Objective: The current function doesn’t show space-only differences. Readers find identical black text and may guess that the reason is a superfluous space character somewhere, or perhaps a period changed into a comma?
Example:
old: The old lady looks confused. new: The young girl looks confused.
The old lady looks▯▯confused. | The young girl looks▯confused. |
- Make space-only differences visible, including heading/trailing space.
- Enable reader to count number of spacing characters.
- Don’t confuse reader with space-▯ if there are visible changes: If one of the adjacent words is already red, space difference is negliable.
- Show not only different number of spacing characters, but also varying types (currently only: ASCII Space U+0020 and HorTab U+0009, but there are many more spaces like U+2004-200A).
Visualize non-ASCII spaces
Objective: Other spaces shall be treated like ASCII space. This goes for both word-splitting and displaying of modification.
Affected unicodes:
2002;EN SPACE 2003;EM SPACE 2004;THREE-PER-EM SPACE 2005;FOUR-PER-EM SPACE 2006;SIX-PER-EM SPACE 2007;FIGURE SPACE 2008;PUNCTUATION SPACE 2009;THIN SPACE 200A;HAIR SPACE
Visualize zero-width differences
Objective: There are modified words where the modification keeps invisible, since a zero-width character has been added or removed. The user encounters two red words without any visible difference.
Affected unicodes:- 00AD;SOFT HYPHEN ­
- 200B;ZERO WIDTH SPACE
- 200C;ZERO WIDTH NON-JOINER ‌
- 200D;ZERO WIDTH JOINER ‍
- 200E;LEFT-TO-RIGHT MARK ‎
- 200F;RIGHT-TO-LEFT MARK ‏
- 202A;LEFT-TO-RIGHT EMBEDDING
- 202B;RIGHT-TO-LEFT EMBEDDING
- 202C;POP DIRECTIONAL FORMATTING
- 202D;LEFT-TO-RIGHT OVERRIDE
- 202E;RIGHT-TO-LEFT OVERRIDE
Example (invisible characters shown as HTML entities):
old: Meaning­less to ‏change‎ direction. new: Meaningless to change direction.
Meaningless to change direction. | Meaningless to change direction. |
The users have no clue why these words are red, give’em one:
Meaning▯less to ▯change▯ direction. | Meaningless to change direction. |
Any red word is affected. Also deleted and added lines are considered – that doesn’t help much, but some users might learn the first time that they are carrying spooky characters.
more…
Project dissemination
In order to turn this into reality, some steps are to be made:
- A project page (best on MW:) needs to be established, and this content shall be copied. (The current talk page has been fine for prenatal issues.)
- A decision is to be prepared whether the proposal is welcome and there should be developed something like windiff3.
- As soon the course of action is clear I do volunteer to create a suite of C++ source codes, merging all the kinda ‘patches’ into a syntactically correct set of subpages.
- Somebody else might establish a test environment, look for bugs, and test in local environment.
- If sufficient, a windiff3 could be set on SVG and performance test are required in testwiki.
- If everybody is happy, the call on the server may be switched from 2 into 3, falling back if major complaints arrive.
Enjoy. --PerfektesChaos 23:04, 11. Mai 2011 (CEST)
- Amendment --PerfektesChaos 10:18, 13. Mai 2011 (CEST)
- Another amendment --PerfektesChaos 22:04, 16. Mai 2011 (CEST)
neugierige frage
bevor ich mich vom acker mache, würde ich gerne wissen, ob meine letzte aussage stimmt, sonst platz ich vor neugier und kann nicht schlafen ;-) --knopfkind 23:11, 6. Okt. 2011 (CEST)
- An dem Tag wurde die Übersetzung der Nachricht angelegt, da die Software-Updates aber immer etwas später sind, kann man das nicht so sagen. Da aber die englische Version auch an dem Tag importiert wurde, scheint an dem Tag die Software-Änderung gemacht worden zu sein. Da am 28. Januar das Feature live ging (laut WP:NEU), war es etwas danach, das stimmt auf jedem Fall. Der Umherirrende 23:14, 6. Okt. 2011 (CEST)
- Ich schau morgen am Wochenende mal, wann genau das war. Interessiert mich auch. Der Umherirrende 23:16, 6. Okt. 2011 (CEST)
- (bk) vielen vielen dank, das reicht mir schon :D. also gibts diesen hinweis in den einstellungen schon mehr als 2 jahre, mehr wollte ich gar nicht wissen ;-) ich weiß noch, dass ungefähr im feb. 2009 über diese änderung im irc gesprochen wurde und auch dass das öffentlich ist (was aber auch logisch ist durch die verwendung in babel-vorlagen), deswegen konnte ich hafenbar nicht versichern, dass das wirklich schon so lange in den einstellungen steht und ich das nicht nur von jemandem aus dem irc wusste. (und da ich mich mit translatewiki und diesen mediawiki systemnachrichten überhaupt nicht auskenne und auf fzw auch nix falsches sagen wollte...) nochmal danke, jetzt kann ich beruhigt schlafen :-) --knopfkind 23:23, 6. Okt. 2011 (CEST)