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

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

From
Luke Diamand <luke@diamand.org>
Date
Apr 5, 2012, 06:54 UTC
Message-ID
<4F7D41B3.7010202@diamand.org>
In-Reply-To
<20120403235247.02c85147@fenix.utopia.dhis.org>
On 03/04/12 23:52, Vitor Antunes wrote:
Show 13 quoted lines
> On Tue,  3 Apr 2012 08:38:35 +0100
> Luke Diamand<luke@diamand.org>  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>
Show 7 quoted lines
>>
>
> 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

Previous: Vitor Antunes
Message 5 of 5 in “[PATCHv1] git-p4: label import, tag export”
  1. Luke DiamandApr 3, 2012
  2. 1/2 git-p4: fix t9800 editor checkLuke Diamand, Apr 3, 2012
  3. 2/2 git-p4: import/export of labels to/from p4Luke Diamand, Apr 3, 2012
  4. Vitor AntunesApr 3, 2012
  5. Luke DiamandApr 5, 2012

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.