git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 6/7] update git-stage.po

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 15, 2011, 13:51 UTC
Message-ID
<20110515135037.GB9422@elie>
In-Reply-To
<BANLkTin3hVusWc-oubW5T-L=mCatubHiKA@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 5 quoted lines
> We should be able to have a merge driver defined for git.git to do
> that using the "Defining a custom merge driver" facility defined in
> gitattributes(5), but I haven't actually tried to make one. But it
> looks easy enough, I'll look at doing that when this becomes a problem
> I have to deal with, and I'm hoping someone beats me to it :)

Heh. Hopefully it won't be hard to do this as a program using libgettextpo. For now my i18n time will be going towards playing with the toolset you've already sent, but afterwards I'd like to try that out.

msgmerge itself cannot perform a 3-way merge, if I understand it correctly --- its purpose is instead to integrate new strings and fuzzies as the document being translated changes over time, while what I would like to do is to combine two changes to a translation without RCS merge(1) [or rather git's ll-merge machinery] being confused by irrelevant changes to line numbers, message order, and line wrapping.

That said, msgmerge can be helpful in almost solving the problem.
To compare old-hu.po and new-hu.po:
	msgmerge old-hu.po po/git.pot >+preimage.po
	msgmerge new-hu.po po/git.pot >+postimage.po
	git diff --no-index +preimage.po +postimage.po

To perform a 3-way merge between ancestor-hu.po, our-hu.po, and their-hu.po:

	msgmerge ancestor-hu.po po/git.pot >+base.po
	msgmerge our-hu.po po/git.pot >+ours.po
	msgmerge their-hu.po po/git.pot >+theirs.po
	git merge-file -L ours -L base -L theirs --stdout \
		+ours.po +base.po +theirs.po >hu.po
Previous: Ævar Arnfjörð BjarmasonNext: Osamu OKANO
Message 19 of 22 in “Document translation with po4a.”
  1. 0/7 Document translation with po4a.Osamu OKANO, May 13, 2011
  2. 1/7 Add new target pot in MakefileOsamu OKANO, May 13, 2011
  3. 2/7 add make(shell) scriptsOsamu OKANO, May 13, 2011
  4. 3/7 cp git-stage.pot ja/git-stage.poOsamu OKANO, May 13, 2011
  5. 4/7 translate ja/git-stage.poOsamu OKANO, May 13, 2011
  6. 5/7 your fileOsamu OKANO, May 13, 2011
  7. Junio C HamanoMay 13, 2011
  8. Drew NorthupMay 13, 2011
  9. 6/7 update git-stage.poOsamu OKANO, May 13, 2011
  10. Junio C HamanoMay 13, 2011
  11. Osamu OKANOMay 14, 2011
  12. Jonathan NiederMay 14, 2011
  13. Junio C HamanoMay 15, 2011
  14. Jonathan NiederMay 15, 2011
  15. Ævar Arnfjörð BjarmasonMay 15, 2011
  16. Jonathan NiederMay 15, 2011
  17. Jonathan NiederMay 15, 2011
  18. Ævar Arnfjörð BjarmasonMay 15, 2011
  19. Jonathan NiederMay 15, 2011
  20. 7/7 translate and remove fazzyOsamu OKANO, May 13, 2011
  21. Junio C HamanoMay 13, 2011
  22. Ævar Arnfjörð BjarmasonMay 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.