After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703983 - Diff page should not consider lines beginning with «#:»
Diff page should not consider lines beginning with «#:»
Status: RESOLVED OBSOLETE
Product: damned-lies
Classification: Infrastructure
Component: vertimus
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: damned-lies Maintainer(s)
damned-lies Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-07-11 07:46 UTC by Daniel Mustieles
Modified: 2018-05-22 12:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to avoid diffs between lines with #: (937 bytes, patch)
2015-03-16 16:26 UTC, Daniel Mustieles
none Details | Review
Patch updated (931 bytes, patch)
2015-03-16 17:06 UTC, Daniel Mustieles
none Details | Review

Description Daniel Mustieles 2013-07-11 07:46:12 UTC
When using the diff page to review a translation, differences between lines beginning with «#:» should not been shown, as they are the line in the source code in which the string appears, but it's not (usually) necessary to know it, and it would simplify the review

For example, this kind of differences could be hidden in the diff:

#: ../src/easytag.c:3164	#: ../src/easytag.c:3161

Thanks!
Comment 1 Daniel Mustieles 2015-03-16 16:26:13 UTC
Created attachment 299529 [details] [review]
Patch to avoid diffs between lines with #:

Here is a patch for this bug. Could you please consider reviewing and applying it?

Thanks!
Comment 2 Claude Paroz 2015-03-16 16:47:34 UTC
Daniel, do you have a live example currently on l10n.gnome.org where I could see the problem and the effect of your patch?
Comment 3 Daniel Mustieles 2015-03-16 16:52:46 UTC
Yes, here you can see there are several differences in lines beginning by #:, 

https://l10n.gnome.org/vertimus/diff/239995/0/1/

These differences do not affect the proofread nor the revision, but really bother the user when proofreading a translation.

Thanks!
Comment 4 Claude Paroz 2015-03-16 17:03:07 UTC
Review of attachment 299529 [details] [review]:

::: stats/utils.py
@@ +392,3 @@
                 status = STATUS_OK+1
         else:
+            command = ("msgconv -t UTF-8 \"%s\" | diff -i -I '^#~' -I '^#:' -u \"%s\" - >/dev/null") % (

As -I accepts a regular expression, shouldn't we change '^#~' to '^#[~:]' instead of providing two -I expressions?
Comment 5 Daniel Mustieles 2015-03-16 17:04:19 UTC
It's ok for me :)
Comment 6 Daniel Mustieles 2015-03-16 17:06:15 UTC
Created attachment 299534 [details] [review]
Patch updated

Here is the patch updated with your suggestion
Comment 7 Claude Paroz 2015-03-16 17:13:25 UTC
In fact, the vertimus diff view has nothing to do with this part of the code, unfortunately. The diff view is constructed here: https://git.gnome.org/browse/damned-lies/tree/vertimus/views.py#n212 (using https://docs.python.org/2/library/difflib.html).
Comment 8 Daniel Mustieles 2015-03-16 17:23:10 UTC
That is the only file I see with the pattern '#~' (which is not shown in the diff view)... that's why I thought that was the correct file.

How/where could we include this pattern?
Comment 9 Claude Paroz 2015-03-16 18:21:30 UTC
Unfortunately, the Python difflib doesn't seem to provide a way to ignore parts of the diff.

Initially, the problem stems from the fact that we don't always remerge all files with the current pot file, but only when some string change. It would be much too heavy for the server to regenerate them at each commit, with no significant gains. One possibility would be to offer a "Resync" button to manually force merging of compared files with the latest pot.
Comment 10 Daniel Mustieles 2015-03-16 18:27:52 UTC
Ok, don't worry. It just was an enhancement suggested to avoid showing useless differences, but if it's not possible in a simple way, it's not a critical bug, so we can forget about it.

Thanks for taking care of this!
Comment 11 GNOME Infrastructure Team 2018-05-22 12:16:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/damned-lies/issues/50.