Create .gitattributes with merge strategy for po files
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.
Related to Tails -
#2 Updated by hefee 2018-03-13 15:44:45
> 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:
the outcome of this is that we nice reformat the file to 79chars, but we loose any change from the other branch :(
#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?
#6 Updated by Anonymous 2018-04-06 10:34:13
> 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.).
#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.