Bug 102784 - Enhance removetooltip_markups.sh script, and add a proper commit hook
Summary: Enhance removetooltip_markups.sh script, and add a proper commit hook
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Marina Latini (SUSE)
URL:
Whiteboard: target:5.4.0
Keywords: difficultyBeginner, easyHack, skillScript, topicCleanup, topicQA
Depends on:
Blocks:
 
Reported: 2016-09-29 08:04 UTC by Muhammet Kara
Modified: 2017-02-14 08:58 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Muhammet Kara 2016-09-29 08:04:41 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Build Identifier: 

This is a spin off from tdf#101549

There were a number of glade .ui files that have tooltip_text and tooltip_markup both set and both set to be translated, and tooltip_markup has been removed to reduce translation burdens and because it has the exact same text as tooltip_text. Where there is no matching tooltip_text, the tooltip_markup was converted into tooltip_text.

Check this commit to see how the .ui files were changed: http://cgit.freedesktop.org/libreoffice/core/commit/?id=652c97b8216c03676bbee08f749e2164e8808c8d

The current script (bin/removetooltip_markups.sh) for this job goes through all .ui files and removes the lines which contain the tooltip_markup string.

This task consists of two steps:

1. Enhance the current script so that it checks to confirm that a tooltip_text entry is available and then remove tooltip_markup, but if tooltip_text isnt available, it should rename tooltip_markup to tooltip_text.

2. Add a commit hook to prevent introduction of new tooltip_markup in .ui files. It should warn the committer, and advise to use only tooltip_text where necessary.

Reproducible: Always







Reset User Profile?
Comment 1 Muhammet Kara 2016-09-29 08:41:16 UTC
Commit hook can be added here: http://opengrok.libreoffice.org/xref/core/.git-hooks/pre-commit

See also http://git-scm.com/book/en/Customizing-Git-Git-Hooks for more info about git hooks.
Comment 2 jani 2016-09-29 10:19:00 UTC
Thanks for the easyHack, makes tracking easier, assign it to yourself, if you want to work on it.
Comment 3 Marina Latini (SUSE) 2016-11-15 12:02:51 UTC
Assigned to myself :)

(In reply to Muhammet Kara from comment #0)

> Build Identifier: 
> 
> This is a spin off from tdf#101549
> 
> There were a number of glade .ui files that have tooltip_text and
> tooltip_markup both set and both set to be translated, and tooltip_markup
> has been removed to reduce translation burdens and because it has the exact
> same text as tooltip_text. Where there is no matching tooltip_text, the
> tooltip_markup was converted into tooltip_text.
> 
> Check this commit to see how the .ui files were changed:
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=652c97b8216c03676bbee08f749e2164e8808c8d
> 
> The current script (bin/removetooltip_markups.sh) for this job goes through
> all .ui files and removes the lines which contain the tooltip_markup string.
> 
> This task consists of two steps:
> 
> 1. Enhance the current script so that it checks to confirm that a
> tooltip_text entry is available and then remove tooltip_markup, but if
> tooltip_text isnt available, it should rename tooltip_markup to tooltip_text.
> 

Some ideas on how to manage this task. :)

> 2. Add a commit hook to prevent introduction of new tooltip_markup in .ui
> files. It should warn the committer, and advise to use only tooltip_text
> where necessary.

This second section needs further investigation. 

> 
> 
> Reset User Profile?

?

ATB,
Marina
Comment 4 jani 2016-11-16 06:36:42 UTC
Changed to ASSIGNED

> > This task consists of two steps:
> > 
> > 1. Enhance the current script so that it checks to confirm that a
> > tooltip_text entry is available and then remove tooltip_markup, but if
> > tooltip_text isnt available, it should rename tooltip_markup to tooltip_text.
> > 
> 
> Some ideas on how to manage this task. :)

it is straight forward, you only need to enhance the current script. If you look at it, you will see it walks through all entries. you need to (for each entry):

check if there are a tooltip_text,
if so remove any tooltip_markup
else if there are a tooltip_markup rename it to tooltip_text
else write the entry in an error log.

The log file, would be excellent as an easyHack (adding missing tooltips).

> 
> > 2. Add a commit hook to prevent introduction of new tooltip_markup in .ui
> > files. It should warn the committer, and advise to use only tooltip_text
> > where necessary.
> 
> This second section needs further investigation. 

Look at comment #1, this is clearly a bit more complex, and a good idea is to submit a patch for 1. first.

> > Reset User Profile?
> 
> ?

I cannot follow this, there are no user profile to reset.
Comment 5 Marina Latini (SUSE) 2016-12-07 21:16:11 UTC
Enhance bin/removetooltip_markups.sh script:
https://gerrit.libreoffice.org/#/c/31596/ -> Needs Code-Review

Enhance git hook:
https://gerrit.libreoffice.org/#/c/31735/ -> Needs Code-Review
Comment 6 Commit Notification 2016-12-08 10:02:49 UTC
Marina Latini committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d3c3f15c3266411266c461103f9098e426f42a80

tdf#102784 Patch 1 - Enhance removetooltip_markups.sh script with checks

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2016-12-08 10:04:58 UTC
Marina Latini committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4f92098da726ec7afbbda54f2b21c29099b622af

tdf#102784 - Enhance git pre-commit hook

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Muhammet Kara 2016-12-08 14:07:30 UTC
Seems resolved. Thanks for the patches!