Re: git: using branches



2009/4/18 Milo Casagrande <milo casagrande name>:
> Hi,
>
> I have some questions/doubts/things I can't understand quite well right
> now with git and how to use branches.
>
> I was trying to commit+push a new Italian translation for gtk+ 2-16
> branch, since looks like it has one string left:
>
> http://l10n.gnome.org/vertimus/gtk+/gtk-2-16/po/it
>
> I switched to origin/gtk-2-16 using this command:
>
> git branch --track -b origin/gtk-2-16
>
> Doing a 'git branch' I saw:
>
>  master
> * origin/gtk-2-16

This should be:
   master
 * gtk-2-16

>
> I downloaded the Italian file from damned-lies, 'git status' showed me
> the modified file.
>
> 'git add po/it.po'

If there is an existing it.po in the repository, it is not required to
'git add'.

>
> 'git commit --signoff --author .... '

The "--signoff" part is not required, so it can be omitted.

> 'git push'
>
> Result: it said everything is up to date, nothing to push.

If you did a commit, then there should be something being pushed.
Did the commit above work? The command would have been something like

git commit it.po -m "Updated Italian translation" --author "The Name
<translator example com>"

You can try 'git push --dry-run' for a test run of the push.

>
> So I switched back to master, deleted the gtk-2-16 branch ('branch -D
> origin/gtk-2-16'), re-checkedout the 2-16 and have done this:
>
> git log

Normally, you do not erase branches of the 'origin/xxxxx' form.
The 'origin/gtk-2-16' branch and anything 'origin/xxxxxx' reside on the server.
I had a look at http://git.gnome.org/cgit/gtk+/log/?h=gtk-2-16
and I notice that no deletion was pushed to git.gnome.org, so it's OK.
In general, you can keep the branches.

>
> And I saw my last commit on 'master' while I'm on 'origin/gtk-2-16'. Is
> this behaviour expected?

Something must have gone wrong when you tried to checkout the branch.
Can you verify which version of 'git' you have? If it is earlier than
1.6.1, then
the above 'checkout' command did not work as expected.

>
> I have done also a 'msgfmt' on it.po, and the result is 997 translated
> as 'master', but still I'm on gtk-2-16 and it should have been, for
> Italian, 996 translated + 1 untranslated.
>
> I double checked the PO-Revision-Date of the it.po in my local copy and
> is the one I pushed on 'master', but 'git branch' says I'm on
> 'origin/gtk-2-16'.
>
> What am I doing wrong here?

Something went wrong with the checkout and we need to update the instructions.
The branch should not be called 'origin/gtk-2-16' but rather 'gtk-2-16'.
You can try to checkout with the command at
http://live.gnome.org/TranslationProject/GitHowTo
which is

git checkout -b gtk-2-16 origin/gtk-2-16

('--track' is default when you use this syntax).

Then, 'git branch' should show

   master
 * gtk-2-16

Simos


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]