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

Re: [PATCHv2 0/4] git-p4: small fixes to branches and labels; tests

From
PWPete Wyckoff <pw@padd.com>
Date
Nov 30, 2011, 22:58 UTC
Message-ID
<20111130225813.GA11544@arf.padd.com>
In-Reply-To
<4ED6809A.9020703@diamand.org>
luke@diamand.org wrote on Wed, 30 Nov 2011 19:14 +0000:
Show 13 quoted lines
> On 30/11/11 14:55, Vitor Antunes wrote:
> >Luke Diamand<luke<at>  diamand.org>  writes:
> >
> >>In adding the test case for labels I also found and fixed a few other
> >>small bugs in the label handling:
> >>
> >>  - labels missing a description or "EOT" in their text cause problems;
> >>  - labels without an owner cause problems.
> >>
> >>I also noticed, but did not fix, that you can't have more than one label
> >>per commit (the others are silently dropped) and the documentation for
> >>branch import could be improved. I've added a (failing) test case for
> >>the multiple label problem.

I was hanging onto your v1, and made a comment on the v1's 3/4 that perhaps you missed. Also acked the entire thing. I can resend if my mailer ate it.

Don't expect Junio to pick it up until after 1.7.8 goes out.
Show 15 quoted lines
> >Hi Luke,
> >
> >Seeing that you have some experience using labels, could I kindly ask you to
> >include some description of it in git-p4.txt?
> 
> OK, if you can help me understand what's going on...
> 
> The label-detection bug that I've described, on further
> investigation, looks to be a fundamental limitation.
> 
> With perforce, I can check out the head revision, and then tag just
> a single file. If I then check out on that tag, I get just that one
> file.
> 
> I think I can't do that with git; certainly fast-import can't do it.

This is another fundamental disconnect between p4 and git. Reading

http://www.perforce.com/perforce/doc.current/manuals/p4guide/07_labels.html

it is clear that labels are supposed to be used exactly where tags cannot: to specify a collection of files as they existed at _different_ points in the commit history.

Thus I think supporting labels is kind of pointless. But in the restricted use case that perforce docs tell us not to do, namely using labels to identify change numbers, git can reflect that with tags.

Show 6 quoted lines
> So the code in git-p4 that is checking the file vs label counts
> (git-p4 around line 1496) is actually trying to say "this label
> can't be imported into git".
> 
> If my understanding is correct, I can then fix my test and update
> the docs and the code to explain this.

Yeah. It's just a big restriction on how labels get imported. A better error message and some docs would be useful.

> As an aside, git-p4.txt currently has quite good information on the
> config variables, but nothing on the command line variables.
> Possibly that should be fixed.

Recently, I wrote an asciidoc-style document for git-p4, and tried to find all the options on all the commands. There's a lot more than I ever knew about. :) I'll take another pass through it then send it out for review. Maybe we can get rid of the old git-p4.txt then and work on improving a more structured document.

		-- Pete
Previous: Vitor AntunesNext: Pete Wyckoff
Message 9 of 17 in “[PATCHv2 0/4] git-p4: small fixes to branches and labels; tests”
  1. Luke DiamandNov 30, 2011
  2. 1/4 git-p4: handle p4 branches and labels containing shell charsLuke Diamand, Nov 30, 2011
  3. 2/4 git-p4: cope with labels with empty descriptionsLuke Diamand, Nov 30, 2011
  4. 3/4 git-p4: importing labels should cope with missing ownerLuke Diamand, Nov 30, 2011
  5. 4/4 git-p4: add test for p4 labelsLuke Diamand, Nov 30, 2011
  6. Vitor AntunesNov 30, 2011
  7. Luke DiamandNov 30, 2011
  8. Vitor AntunesNov 30, 2011
  9. Pete WyckoffNov 30, 2011
  10. Pete WyckoffNov 30, 2011
  11. Vitor AntunesDec 1, 2011
  12. Pete WyckoffDec 4, 2011
  13. Luke DiamandDec 1, 2011
  14. Vitor AntunesDec 1, 2011
  15. Pete WyckoffDec 1, 2011
  16. Vitor AntunesDec 1, 2011
  17. Luke DiamandDec 2, 2011

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.