{"thread":{"id":"32521","subject":"Suggested improvements to the git-p4 documentation (branch-related)","startedAt":"2013-01-03T20:58:05Z","lastAt":"2013-02-23T19:11:04Z","messageCount":6,"participants":["Olivier Delalleau","Pete Wyckoff","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205954","messageId":"CAFXk4bqt_pMVDtVKF-JiQuGbSpy2+_rGOg5RTTE+0pNKFcZh3w@mail.gmail.com","threadId":"32521","inReplyTo":null,"subject":"Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Olivier Delalleau","fromEmail":"shish@keba.be","sentAt":"2013-01-03T20:58:05Z","receivedAt":"2013-01-03T20:58:05Z","isPatch":false,"sender":{"key":"shish@keba.be","avatar":null},"body":"Hi,\n\nWhile struggling to get git-p4 to work properly with branches, I\nthought the documentation on http://git-scm.com/docs/git-p4 could use\nsome improvements:\n\n1. At the end of the \"Branch detection\" section, the following\ncommands are provided (for when you want to explicitly provide branch\nmappings to git-p4):\n\ngit config git-p4.branchList main:branch1\ngit p4 clone --detect-branches //depot@all\n\nThe second command should end with a dot (\".\") because the first\ncommand only works if you are already in a git-initialized folder.\nThus I would also suggest to add \"git init\" as first command to type.\n\n2. Even though having a \"main\" branch is standard in Perforce, it\nwould be worth mentioning what happens when you don't: there is a\nmessage \"Could not detect main branch. No checkout/master branch\ncreated\" output by the \"git p4 clone\" command. However, it will still\nwork if you manually set the master branch (\"git checkout -b master\nremotes/p4/my_custom_main_branch\").\n\n3. I don't know what I missed for that one, but I haven't been able to\nget the example for the --branch option to work. It says that after\n\"git init\", we can import a p4 branch with:\n\ngit p4 sync --branch=refs/remotes/p4/proj2 //depot/proj2\n\nHowever, after doing this, followed by \"git checkout -b proj2\nremotes/p4/proj2\", I am unable to properly use \"git p4 sync\" or \"git\np4 submit\" from this branch, as git complains about a missing\nrefs/remotes/p4/master.\nMaybe it only works if \"git clone\" has been used before? But then why\nhave \"git init\" first?\n\nNB: it's quite possible some of my problems were caused by me not\nproperly understanding the doc / how git/p4 works. My apologies if\nthat's the case.\n\n-=- Olivier\n"},{"id":"206049","messageId":"20130105212517.GA30315@padd.com","threadId":"32521","inReplyTo":"CAFXk4bqt_pMVDtVKF-JiQuGbSpy2+_rGOg5RTTE+0pNKFcZh3w@mail.gmail.com","subject":"Re: Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2013-01-05T21:25:17Z","receivedAt":"2013-01-05T21:25:17Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"shish@keba.be wrote on Thu, 03 Jan 2013 15:58 -0500:\n> While struggling to get git-p4 to work properly with branches, I\n> thought the documentation on http://git-scm.com/docs/git-p4 could use\n> some improvements:\n\nThanks, I definitely appreciate the constructive comments here.\n\n> 1. At the end of the \"Branch detection\" section, the following\n> commands are provided (for when you want to explicitly provide branch\n> mappings to git-p4):\n> \n> git config git-p4.branchList main:branch1\n> git p4 clone --detect-branches //depot@all\n> \n> The second command should end with a dot (\".\") because the first\n> command only works if you are already in a git-initialized folder.\n> Thus I would also suggest to add \"git init\" as first command to type.\n\nThat is confusing.  I'll make it this:\n\n    git init depot\n    cd depot\n    git config git-p4.branchList main:branch1\n    git p4 clone --detect-branches //depot@all .\n\n> 2. Even though having a \"main\" branch is standard in Perforce, it\n> would be worth mentioning what happens when you don't: there is a\n> message \"Could not detect main branch. No checkout/master branch\n> created\" output by the \"git p4 clone\" command. However, it will still\n> work if you manually set the master branch (\"git checkout -b master\n> remotes/p4/my_custom_main_branch\").\n\nThis feels like a bug to me, and indeed I had an old patch series\nthat planned to fix it.  Let me knock that into shape, instead of\nchanging the documentation.  It will automatically do the\ncheckout step you did.\n\n> 3. I don't know what I missed for that one, but I haven't been able to\n> get the example for the --branch option to work. It says that after\n> \"git init\", we can import a p4 branch with:\n> \n> git p4 sync --branch=refs/remotes/p4/proj2 //depot/proj2\n> \n> However, after doing this, followed by \"git checkout -b proj2\n> remotes/p4/proj2\", I am unable to properly use \"git p4 sync\" or \"git\n> p4 submit\" from this branch, as git complains about a missing\n> refs/remotes/p4/master.\n\nYes, also annoying.  I have a failing test case for this, but\nhaven't fixed it yet.  The idea is that \"git p4 sync --branch=proj2\"\nwill sync refs/remotes/p4/proj2.  If there is no p4/master, and\nyou don't specify --branch, it will fail with a more useful error\nmessage.\n\nFor submit, there is code that walks from your current branch\nback in history until it finds a commit on a known p4 remote\nbranch.  This is sort of like the merge-base calculation in git,\nbut restricted to a linear history.  I haven't tested that\nrecently, but will add a test and fix it if needed too.\n\n\nPlease do feel welcome to to rearrange or expand the\ndocumentation so it makes more sense, if you are so inspired.\n\n\t\t-- Pete\n"},{"id":"206197","messageId":"CAFXk4bp0MBNxOD7w1zn7peN-ufWmV=DthMdHmjmj+Sci4MGneg@mail.gmail.com","threadId":"32521","inReplyTo":"20130105212517.GA30315@padd.com","subject":"Re: Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Olivier Delalleau","fromEmail":"shish@keba.be","sentAt":"2013-01-07T02:00:42Z","receivedAt":"2013-01-07T02:00:42Z","isPatch":false,"sender":{"key":"shish@keba.be","avatar":null},"body":"2013/1/5 Pete Wyckoff <pw@padd.com>:\n> shish@keba.be wrote on Thu, 03 Jan 2013 15:58 -0500:\n>> While struggling to get git-p4 to work properly with branches, I\n>> thought the documentation on http://git-scm.com/docs/git-p4 could use\n>> some improvements:\n>\n> Thanks, I definitely appreciate the constructive comments here.\n>\n>> 1. At the end of the \"Branch detection\" section, the following\n>> commands are provided (for when you want to explicitly provide branch\n>> mappings to git-p4):\n>>\n>> git config git-p4.branchList main:branch1\n>> git p4 clone --detect-branches //depot@all\n>>\n>> The second command should end with a dot (\".\") because the first\n>> command only works if you are already in a git-initialized folder.\n>> Thus I would also suggest to add \"git init\" as first command to type.\n>\n> That is confusing.  I'll make it this:\n>\n>     git init depot\n>     cd depot\n>     git config git-p4.branchList main:branch1\n>     git p4 clone --detect-branches //depot@all .\n\nSounds good, thanks.\n\n>\n>> 2. Even though having a \"main\" branch is standard in Perforce, it\n>> would be worth mentioning what happens when you don't: there is a\n>> message \"Could not detect main branch. No checkout/master branch\n>> created\" output by the \"git p4 clone\" command. However, it will still\n>> work if you manually set the master branch (\"git checkout -b master\n>> remotes/p4/my_custom_main_branch\").\n>\n> This feels like a bug to me, and indeed I had an old patch series\n> that planned to fix it.  Let me knock that into shape, instead of\n> changing the documentation.  It will automatically do the\n> checkout step you did.\n\nSounds good as well.\n\n>\n>> 3. I don't know what I missed for that one, but I haven't been able to\n>> get the example for the --branch option to work. It says that after\n>> \"git init\", we can import a p4 branch with:\n>>\n>> git p4 sync --branch=refs/remotes/p4/proj2 //depot/proj2\n>>\n>> However, after doing this, followed by \"git checkout -b proj2\n>> remotes/p4/proj2\", I am unable to properly use \"git p4 sync\" or \"git\n>> p4 submit\" from this branch, as git complains about a missing\n>> refs/remotes/p4/master.\n>\n> Yes, also annoying.  I have a failing test case for this, but\n> haven't fixed it yet.  The idea is that \"git p4 sync --branch=proj2\"\n> will sync refs/remotes/p4/proj2.  If there is no p4/master, and\n> you don't specify --branch, it will fail with a more useful error\n> message.\n\nGood too!\n\n> For submit, there is code that walks from your current branch\n> back in history until it finds a commit on a known p4 remote\n> branch.  This is sort of like the merge-base calculation in git,\n> but restricted to a linear history.  I haven't tested that\n> recently, but will add a test and fix it if needed too.\n>\n>\n> Please do feel welcome to to rearrange or expand the\n> documentation so it makes more sense, if you are so inspired.\n\nI'm afraid I'm not familiar enough with git documentation to dig into\nit myself, but anyway that's about what I had for now. I'll send more\ncomments to the mailing list if I have more suggestions in the future.\n\nThanks for a great tool! :)\n\n-=- Olivier\n"},{"id":"210080","messageId":"7va9qvc13r.fsf@alter.siamese.dyndns.org","threadId":"32521","inReplyTo":"CAFXk4bp0MBNxOD7w1zn7peN-ufWmV=DthMdHmjmj+Sci4MGneg@mail.gmail.com","subject":"Re: Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-23T00:42:16Z","receivedAt":"2013-02-23T00:42:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Olivier Delalleau <shish@keba.be> writes:\n\n> 2013/1/5 Pete Wyckoff <pw@padd.com>:\n>> shish@keba.be wrote on Thu, 03 Jan 2013 15:58 -0500:\n> ...\n>> Please do feel welcome to to rearrange or expand the\n>> documentation so it makes more sense, if you are so inspired.\n>\n> I'm afraid I'm not familiar enough with git documentation to dig into\n> it myself, but anyway that's about what I had for now. I'll send more\n> comments to the mailing list if I have more suggestions in the future.\n>\n> Thanks for a great tool! :)\n\nDid anything come out of this thread?  If neither of you two are\ninclined to conclude the discussion with a final patch, I'd\nappreciate anybody else who does the honors ;-)\n\nWe'll be in deep pre-release freeze for a few weeks, so there is no\nneed to rush.\n\nThanks.\n"},{"id":"210089","messageId":"20130223144803.GA5444@padd.com","threadId":"32521","inReplyTo":"7va9qvc13r.fsf@alter.siamese.dyndns.org","subject":"Re: Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2013-02-23T14:48:03Z","receivedAt":"2013-02-23T14:48:03Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"gitster@pobox.com wrote on Fri, 22 Feb 2013 16:42 -0800:\n> Olivier Delalleau <shish@keba.be> writes:\n> \n> > 2013/1/5 Pete Wyckoff <pw@padd.com>:\n> >> shish@keba.be wrote on Thu, 03 Jan 2013 15:58 -0500:\n> > ...\n> >> Please do feel welcome to to rearrange or expand the\n> >> documentation so it makes more sense, if you are so inspired.\n> >\n> > I'm afraid I'm not familiar enough with git documentation to dig into\n> > it myself, but anyway that's about what I had for now. I'll send more\n> > comments to the mailing list if I have more suggestions in the future.\n> >\n> > Thanks for a great tool! :)\n> \n> Did anything come out of this thread?  If neither of you two are\n> inclined to conclude the discussion with a final patch, I'd\n> appreciate anybody else who does the honors ;-)\n> \n> We'll be in deep pre-release freeze for a few weeks, so there is no\n> need to rush.\n\nTwo of Olivier's suggestions were best classified as code, not\ndocumentation, bugs.  I finished off some ongoing work that fixed\nthose along the way.  The third led to a fix to the\ndocumentation, 182edef (git p4 doc: fix branch detection example,\n2013-01-14), that I added as part of that series.\n\nAll of it is in master now, via 801cbd7 (Merge branch\n'pw/p4-branch-fixes', 2013-01-21).\n\nI should have commented on this thread too.  Thanks for following\nup!\n\n\t\t-- Pete\n"},{"id":"210102","messageId":"7v1uc6977b.fsf@alter.siamese.dyndns.org","threadId":"32521","inReplyTo":"20130223144803.GA5444@padd.com","subject":"Re: Suggested improvements to the git-p4 documentation (branch-related)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-23T19:11:04Z","receivedAt":"2013-02-23T19:11:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pete Wyckoff <pw@padd.com> writes:\n\n> All of it is in master now, via 801cbd7 (Merge branch\n> 'pw/p4-branch-fixes', 2013-01-21).\n>\n> I should have commented on this thread too.  Thanks for following\n> up!\n\nThanks.\n"}]}