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

git merge and GNU gettext po files - how to avoid conflicts?

From
DBDavid Bruce <davidstuartbruce@gmail.com>
Date
Jul 10, 2010, 01:40 UTC
Message-ID
<AANLkTinaGzopi8-inuum_rXEzyTcWTD6vvUXRb0yAHLg@mail.gmail.com>
Hello,

First of all, is this list suitable for git usage questions as opposed to git development? If not, what list is more appropriate?

Assuming this is an appropriate list, here is the issue:
The .po files used by gettext are largely human-generated, so they
need to be under scm control.  However, they are also programatically
altered when certain make targets are run.  When this happens, a line
in the .po file gets updated with timestamp info (not talking about a
filesystem timestamp here, but a change in the text file).  So, if two
branches have been worked on for a while and the updated .po files
have been committed in each branch, they will generate conflicts when
a merge is attempted.  Since our programs have lots of translations,
it is a pain to resolve all the conflicts by hand. What is a good way
to avoid this in git? My thought would be:
1. generate a diff between the .po files in the po/ directories of the
two branches, e.g.
(assuming we are trying to merge a branch named "feature" back with master):
git diff master feature po/*.po

and look to see if any differences are these innocuous, autogenerated differences. Perhaps some other type of diff would be more useful, such as diffs from a common ancestor?

2. If the diff shows that one of the branches has no changes in
po/*.po that need to be kept, is there a way to tell git to "merge
feature with master, but for po/*.po differences just use the file
from feature instead of generating conflicts".  Or, should I just
manually copy all the *.po files from one branch into the other branch
and commit them prior to attempting the merge?

It seems someone must have encountered and solved this problem before, but I haven't have much luck with Google, so I'd greatly appreciate hearing from someone with expertise.

Thanks for any help,
David Bruce
Next: Jakub Narebski
Message 1 of 2 in “git merge and GNU gettext po files - how to avoid conflicts?”
  1. David BruceJul 10, 2010
  2. Jakub NarebskiJul 10, 2010

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.