2013/4/11 Harring Figueiredo <harri...@gmail.com>:
> How do I pull the git.pot from my upstream?

First add git://github.com/git-l10n/git-po.git as a new remote if you have not
do this and fetch from it.

    $ git remote add git-po git://github.com/git-l10n/git-po.git
    $ git fetch git-po

After that, the commit with the update 'git.pot' is stored in branch
remote/git-po/master.

    $ git log --oneline -1 git-po/master
    c138a l10n: git.pot: v1.8.3 round 1 (54 new, 15 removed)

Run the following command, you can find your local commits not in upstream.

    $ git log --oneline git-po/master..
    0ade1 l10n: Translation updates.
    3a731 ln10: Added more translation. No merge needed.
    69989 l10n: Merge remote-tracking branch 'upstream/master'
    b32bb l10n: Translated 61 messages
    8e534 l10n: Init of Brazilian Portuguese translation

I found there is a merge commit (commit 69989) already.

In order to update your local 'po/git.pot' file, you have TWO selection.
One is merge, another is rebase.

If you choose merge like the follows,

    $ git merge -q --no-edit git-po/master

, then there would be a new merge commit in your local repo but not in upstream:

    $ git log --oneline git-po/master..
    8a699 Merge remote-tracking branch 'git-po/master' into WIP/pt_BR/master
    0ade1 l10n: Translation updates.
    3a731 ln10: Added more translation. No merge needed.
    69989 l10n: Merge remote-tracking branch 'upstream/master'
    b32bb l10n: Translated 61 messages
    8e534 l10n: Init of Brazilian Portuguese translation

But if you use rebase instead of merge,

    $ git rebase git-po/master
    First, rewinding head to replay your work on top of it...
    Applying: l10n: Init of Brazilian Portuguese translation
    Applying: l10n: Translated 61 messages
    Applying: ln10: Added more translation. No merge needed.
    Applying: l10n: Translation updates.

after rebase, then your may find in the polished master branch
of you local repo, the old merge commit (such as 69989
l10n: Merge remote-tracking branch 'upstream/master') is discarded.
(Please note after rebase the commit-ish would be changed, and
 yours must be different.)

    $ git log --oneline git-po/master..
    a338e l10n: Translation updates.
    0d36a ln10: Added more translation. No merge needed.
    2a7a6 l10n: Translated 61 messages
    70b2 l10n: Init of Brazilian Portuguese translation

After rebase, you can not push directly, must push with --force option, like

    git push --force origin

> Once I do that, what else do I need to do to update my .po and leave my repo
> in a manner that I can commit to my remote?

You can find instructions in "Updating a XX.po file" section of
'po/README' file.

1. change cwd.

    $ cd po/

2. Current statistics of your pt_BR.po

    $ msgfmt -o /dev/null --statistics pt_BR.po
    158 translated messages, 1851 untranslated messages.

3. Update pt_BR.po from the new update git.pot

    $ msgmerge --add-location --backup=off -U pt_BR.po  git.pot

4. Then you may see pt_BR.po changed:

    $ msgfmt -o /dev/null --statistics pt_BR.po
    155 translated messages, 14 fuzzy translations, 1879 untranslated messages.

5. Commit the changed pt_BR.po, and start your translation.

When you feel translations of 'pt_BR.po' is ok for me to pull, send me
a pull request. But you'd better squash all these trivial commits into one
big initial commit, because so many trivial commits are boring, and may
have bad impact on git repository statistics. Junio has a blog on how he
do statistics:

* http://git-blame.blogspot.com/2013/03/so-how-well-are-we-doing-lately.html

BTW, kick back to the list for future reference.

--
Jiang Xin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to