Subject: Re: [PATCHv1 2/2] git-p4: import/export of labels to/from p4

From: Luke Diamand <[email-masked]>
Date: Thu, 05 Apr 2012 07:54:43 +0100

On 03/04/12 23:52, Vitor Antunes wrote:
> On Tue,  3 Apr 2012 08:38:35 +0100
> Luke Diamand<[email-masked]>  wrote:
>
>> The existing label import code looks at each commit being
>> imported, and then checks for labels at that commit. This
>> doesn't work in the real world though because it will drop
>> labels applied on changelists that have already been imported,
>> a common pattern.
>>
>> This change adds a new --import-labels option. With this option,
>> at the end of the sync, git-p4 gets sets of labels in p4 and git,
>> and then creates a git tag for each missing p4 label.
>>

<snip>

>>
>
> Would it be possible to only export git tags during commit?
>
> I don't think it is intuitive to make changes in P4 during sync operation.
> And because it is possible to configure git-p4 to always export tags it will
> be easy to forget that while sync'ing we are also updating P4.

Commit isn't a great time to do it because you don't know the p4 
changelist number for your git commits.

e.g.

git commit -m 'Some change'
git tag -a MYTAG -m 'whatever'
git-p4 submit [--export-tags]

======= the tag must be ignored here ========
======= as you don't know the p4 cl  ========

git-p4 sync --export-tags
======= *Now* you know the p4 cl     ========

So it either has to be part of sync/rebase, or we add a new command, 
e.g. git-p4 export-tags (and presumably git-p4 import-tags). But that 
seems awkward as well.

>
> I still did not test the patch in my branch environment, so I may have more
> updates later. But for now, everything else seems ok by me.
>

Thanks,
Luke