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

Re: [PATCH 1/4] git-p4: handle p4 branches and labels containing shell chars

From
Luke Diamand <luke@diamand.org>
Date
Jan 19, 2012, 09:12 UTC
Message-ID
<4F17DE70.2010204@diamand.org>
In-Reply-To
<20120117223949.GA811@padd.com>
On 17/01/12 22:39, Pete Wyckoff wrote:
Show 25 quoted lines
> luke@diamand.org wrote on Mon, 16 Jan 2012 23:14 +0000:
>> Don't use shell expansion when detecting branches, as it will
>> fail if the branch name contains a shell metachar. Similarly
>> for labels.
>>
>> Add additional test for branches with shell metachars.
>
> Nice.  There will be a fixup on a command in Vitor's series,
> depending on which goes first.  He'll have a couple of
> un-listified read_pipe{,_lines} that we should treat similarly.
>
>> @@ -1758,7 +1758,7 @@ class P4Sync(Command, P4UserMap):
>>       def getLabels(self):
>>           self.labels = {}
>>
>> -        l = p4CmdList("labels %s..." % ' '.join (self.depotPaths))
>> +        l = p4CmdList(["labels", "%s..." % ' '.join (self.depotPaths)])
>>           if len(l)>  0 and not self.silent:
>>               print "Finding files belonging to labels in %s" % `self.depotPaths`
>
> I suspect the command "p4" "labels" "//depot/foo/...  //depot/bar/..."
> might confuse p4, but haven't tested.  Maybe tuck each one in its
> own argument?
>
>      ["labels"] + ["%s..." % p for p in self.depotPaths]

Yes, you're right. I'll resubmit. I suspect the previous code was actually broken as well as you end up with the "..." only on the last depot.

>
> What happened to your failing test?  It's fun to keep the broken
> ones around to inspire others to fix them.

I'll send that one through as well. I actually had a fix, but it needs to be reworked now. I'm reluctant to try to do much more on this though unless someone can tell me how the --detect-labels code can ever really work.

i.e. if you do:
  p4 submit
  git-p4 rebase --detect-labels
  p4 tag LABEL_A
  git-p4 rebase --detect-labels
At this point, LABEL_A won't show up in git until the _next_ p4 commit.
It's slowly working it's way towards the top of my todo list though!

Regards! Luke

Previous: Pete WyckoffNext: Luke Diamand
Message 4 of 7 in “[PATCHv3 0/4] git-p4: small fixes to branches and labels”
  1. Luke DiamandJan 16, 2012
  2. 1/4 git-p4: handle p4 branches and labels containing shell charsLuke Diamand, Jan 16, 2012
  3. Pete WyckoffJan 17, 2012
  4. Luke DiamandJan 19, 2012
  5. 2/4 git-p4: cope with labels with empty descriptionsLuke Diamand, Jan 16, 2012
  6. 3/4 git-p4: importing labels should cope with missing ownerLuke Diamand, Jan 16, 2012
  7. 4/4 git-p4: add test for p4 labelsLuke Diamand, Jan 16, 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.