Feature #15364

Create .gitattributes with merge strategy for po files

Added by Anonymous 2018-03-02 15:30:32 . Updated 2019-06-27 17:16:54 .

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Target version:
Start date:
2018-03-02
Due date:
% Done:

0%

Feature Branch:
https://0xacab.org/Hefee/merge-po
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

gitattributes (shell)

implement a special merge strategy for po files (unify headers) → this file will propagate to all git clones and prevent merge conflicts upon po header modifications in two places at once. We’ve seen this happen too often, and we want to automate this so it does not happen.

To be done: define a bit more clearly what/how to unify the po headers.


Subtasks


Related issues

Related to Tails - Bug #15403: Unify po headers Resolved 2018-08-19

History

#1 Updated by hefee 2018-03-13 14:29:05

addionally to Bug #15403 there are more headers to unify before merge:

  • X-Generator: use from main git not from weblate
  • Plural-Forms
  • Report-Msgid-Bugs-To

msgmerge or msgcomm could help to do the “real” merge work.

#2 Updated by hefee 2018-03-13 15:44:45

hefee wrote:
> msgmerge or msgcomm could help to do the “real” merge work.

I tried so far a mergestrategy .git/config:

[merge "msgmerge"]
        name = msgmerge
        driver = msgmerge -w 79 --previous -o %A %B %A

and added to wiki/src/.gitattributes:

*po merge=msgmerge

the outcome of this is that we nice reformat the file to 79chars, but we loose any change from the other branch :(

#3 Updated by hefee 2018-03-22 16:13:44

I created now a repository with tests, so we can simply have an environment for testing mergetools and have unittests to make sure, they do what we want them to do :D

https://0xacab.org/Hefee/merge-po

#4 Updated by Anonymous 2018-04-03 12:27:04

I implemented such a thing on the weblate platform using the merge-gettext-po driver from https://docs.weblate.org/en/latest/admin/continuous.html#updating-repositories Would this be useful wfor our gitattributes?

#5 Updated by Anonymous 2018-04-06 10:20:45

  • related to Bug #15408: Consider forcing wrapping of po files at 79 chars per line added

#6 Updated by Anonymous 2018-04-06 10:34:13

u wrote:
> I implemented such a thing on the weblate platform using the merge-gettext-po driver from https://docs.weblate.org/en/latest/admin/continuous.html#updating-repositories Would this be useful wfor our gitattributes?

-> talked with hefee about this and we would rather use his / the italian’s merge driver, which we shall complete with more (check against pot files etc.).

#7 Updated by bertagaz 2018-05-10 11:09:11

  • Target version changed from Tails_3.7 to Tails_3.8

#8 Updated by Anonymous 2018-05-17 08:44:38

  • Feature Branch set to https://0xacab.org/Hefee/merge-po

#9 Updated by Anonymous 2018-05-17 14:08:22

  • related to deleted (Bug #15408: Consider forcing wrapping of po files at 79 chars per line)

#10 Updated by Anonymous 2018-05-17 14:08:37

#11 Updated by Anonymous 2018-05-29 09:40:17

  • Feature Branch changed from https://0xacab.org/Hefee/merge-po to tails.git:translation_platform_hooks

#12 Updated by Anonymous 2018-05-29 09:40:42

  • Feature Branch changed from tails.git:translation_platform_hooks to https://0xacab.org/Hefee/merge-po

#13 Updated by Anonymous 2018-06-12 13:05:58

Status of this ticket: think a bit more in detail about what to generate the potfiles from, finish the script.

#14 Updated by Anonymous 2018-06-19 10:57:18

Then test live. What can go wrong?

#15 Updated by intrigeri 2018-06-26 16:27:47

  • Target version changed from Tails_3.8 to Tails_3.9

#16 Updated by intrigeri 2018-09-05 16:26:50

  • Target version changed from Tails_3.9 to Tails_3.10.1

#17 Updated by intrigeri 2018-10-24 17:03:33

  • Target version changed from Tails_3.10.1 to Tails_3.11

#18 Updated by CyrilBrulebois 2018-12-16 14:05:57

  • Target version changed from Tails_3.11 to Tails_3.12

#19 Updated by hefee 2019-01-11 16:09:52

  • Target version deleted (Tails_3.12)

#20 Updated by hefee 2019-02-08 22:53:45

It is a more nice-to-have feature not a blocker for anything.

#21 Updated by intrigeri 2019-03-12 17:07:06

  • Deliverable for deleted (Sponsor_L)

#22 Updated by hefee 2019-06-03 09:45:02

  • Status changed from Confirmed to Rejected

We have written a merge strategy for Weblate, see puppet-tails.git:files/weblate/scripts/update_weblate_git.py. A .gitattribute solution does not work, as the merge handle is only called, if git thinks, it needs to merge. As we have more rules about how and when a merge should happen .gitattribute is NOT a solution at all.

#23 Updated by intrigeri 2019-06-27 17:16:54

  • Assignee deleted (hefee)