From: Jakub Narebski <jnareb@gmail.com>
To: David Bruce <davidstuartbruce@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git merge and GNU gettext po files - how to avoid conflicts?
Date: Sat, 10 Jul 2010 01:51:17 -0700 (PDT) [thread overview]
Message-ID: <m3pqyvlnz9.fsf@localhost.localdomain> (raw)
In-Reply-To: <AANLkTinaGzopi8-inuum_rXEzyTcWTD6vvUXRb0yAHLg@mail.gmail.com>
David Bruce <davidstuartbruce@gmail.com> writes:
> First of all, is this list suitable for git usage questions as opposed
> to git development? If not, what list is more appropriate?
Yes, it is appropriate list.
> 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?
3. Create a merge driver intended specially for merging *.po files,
just like there exists (in the wild) the strategy to merge ChangeLog
files. Then use gitattributes mechanism to associate this merge
strategy with *.po files via `merge' attribute.
But it might be not easy...
--
Jakub Narebski
Poland
ShadeHawk on #git
prev parent reply other threads:[~2010-07-10 8:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-10 1:40 git merge and GNU gettext po files - how to avoid conflicts? David Bruce
2010-07-10 8:51 ` Jakub Narebski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3pqyvlnz9.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=davidstuartbruce@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox