{"thread":{"id":"27101","subject":"git-p4 issue","startedAt":"2011-04-15T03:00:43Z","lastAt":"2011-12-17T05:52:57Z","messageCount":13,"participants":["Michael Horowitz","Tor Arvid Lund","Pete Wyckoff","Vitor Antunes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"165874","messageId":"BANLkTikeQSqAhm2CwCYBkE74OxPUnA0cOg@mail.gmail.com","threadId":"27101","inReplyTo":null,"subject":"git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-04-15T03:00:43Z","receivedAt":"2011-04-15T03:00:43Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"Pete,\n\nI was hoping you could help me out again.  After using git-p4 for a\nwhile without a problem, it has suddenly stopped working for me.  I am\nusing the latest master.  I haven't seen any recent changes that I\nthink could have caused this, but maybe you'll have some insight.\n\nThe issue is that when I do a git-p4 sync on my existing repository,\nit reports success, but seems to do nothing.  It does not download the\nlatest changes from p4.  If I delete my repository and start over, it\nwill download all the latest changes, even the ones it was not\ndownloading previously, but if I try to sync again later, it does not\ndo anything.  I tried running it with the \"--verbose\" mode, and I see\nit says it is loading each of the changes, but they are not ending up\nin the git repository, and it is not reporting any errors.\n\nAny ideas of what this could be?  Is there anything else I can run to\nhelp debug this?\n\nThanks,\n\nMike\n"},{"id":"165929","messageId":"BANLkTimmVQAcx7hiQFUBcoAGdvPhktPuMg@mail.gmail.com","threadId":"27101","inReplyTo":"BANLkTikeQSqAhm2CwCYBkE74OxPUnA0cOg@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2011-04-15T20:22:29Z","receivedAt":"2011-04-15T20:22:29Z","isPatch":false,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"On Fri, Apr 15, 2011 at 5:00 AM, Michael Horowitz\n<michael.horowitz@ieee.org> wrote:\n> Pete,\n>\n> I was hoping you could help me out again.  After using git-p4 for a\n> while without a problem, it has suddenly stopped working for me.  I am\n> using the latest master.  I haven't seen any recent changes that I\n> think could have caused this, but maybe you'll have some insight.\n>\n> The issue is that when I do a git-p4 sync on my existing repository,\n> it reports success, but seems to do nothing.  It does not download the\n> latest changes from p4.  If I delete my repository and start over, it\n> will download all the latest changes, even the ones it was not\n> downloading previously, but if I try to sync again later, it does not\n> do anything.  I tried running it with the \"--verbose\" mode, and I see\n> it says it is loading each of the changes, but they are not ending up\n> in the git repository, and it is not reporting any errors.\n\nHi, Michael.\n\nIs it possible that you expect that 'git p4 sync' should update your\nworking branch and/or working tree? Assuming a simple clone with a\nlocal master branch, running 'git-p4 sync' will update the branch\nremotes/p4/master, but it won't do anything on my working master\nbranch...\n\nMaybe you want to call 'git rebase p4/master' afterwards, or use the\nshorthand 'git p4 rebase' to do a sync+rebase.\n\nRegards,\nTor Arvid.\n\n> Any ideas of what this could be?  Is there anything else I can run to\n> help debug this?\n>\n> Thanks,\n>\n> Mike\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"165931","messageId":"BANLkTikDDDtyJB992DFNtvgMrGvbWf=rMw@mail.gmail.com","threadId":"27101","inReplyTo":"BANLkTimmVQAcx7hiQFUBcoAGdvPhktPuMg@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-04-15T20:39:54Z","receivedAt":"2011-04-15T20:39:54Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"I am sure that is a common mistake people make, but not in this case.\nI have been using it successfully for a while now, it just suddenly\nstopped working, not sure what changed.  I am not seeing anything on\nremotes/p4/master either, and I was originally doing rebase and went\nback to sync so I could run \"--verbose\" and see if it was even\ndownloading those changes.  I can clearly see it says it is\ndownloading them, but then they just don't end up in git.\n\nSince I don't see an error message about it failing to sync, I am at a\nloss to figure out why it says it succeeded, but it didn't.  Could\nthere be one step in the code that is not catching an error condition?\n I am not all that familiar with Python, but if someone could point me\nwhere to put some debug messages, I can do some testing.\n\nThanks,\n\nMike\n\n\n\nOn Fri, Apr 15, 2011 at 4:22 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:\n>\n> On Fri, Apr 15, 2011 at 5:00 AM, Michael Horowitz\n> <michael.horowitz@ieee.org> wrote:\n> > Pete,\n> >\n> > I was hoping you could help me out again.  After using git-p4 for a\n> > while without a problem, it has suddenly stopped working for me.  I am\n> > using the latest master.  I haven't seen any recent changes that I\n> > think could have caused this, but maybe you'll have some insight.\n> >\n> > The issue is that when I do a git-p4 sync on my existing repository,\n> > it reports success, but seems to do nothing.  It does not download the\n> > latest changes from p4.  If I delete my repository and start over, it\n> > will download all the latest changes, even the ones it was not\n> > downloading previously, but if I try to sync again later, it does not\n> > do anything.  I tried running it with the \"--verbose\" mode, and I see\n> > it says it is loading each of the changes, but they are not ending up\n> > in the git repository, and it is not reporting any errors.\n>\n> Hi, Michael.\n>\n> Is it possible that you expect that 'git p4 sync' should update your\n> working branch and/or working tree? Assuming a simple clone with a\n> local master branch, running 'git-p4 sync' will update the branch\n> remotes/p4/master, but it won't do anything on my working master\n> branch...\n>\n> Maybe you want to call 'git rebase p4/master' afterwards, or use the\n> shorthand 'git p4 rebase' to do a sync+rebase.\n>\n> Regards,\n> Tor Arvid.\n>\n> > Any ideas of what this could be?  Is there anything else I can run to\n> > help debug this?\n> >\n> > Thanks,\n> >\n> > Mike\n> > --\n> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n> > the body of a message to majordomo@vger.kernel.org\n> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> >\n"},{"id":"165965","messageId":"20110416160109.GA19557@arf.padd.com","threadId":"27101","inReplyTo":"BANLkTikDDDtyJB992DFNtvgMrGvbWf=rMw@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-04-16T16:01:09Z","receivedAt":"2011-04-16T16:01:09Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"michael.horowitz@ieee.org wrote on Fri, 15 Apr 2011 16:39 -0400:\n> I am sure that is a common mistake people make, but not in this case.\n> I have been using it successfully for a while now, it just suddenly\n> stopped working, not sure what changed.  I am not seeing anything on\n> remotes/p4/master either, and I was originally doing rebase and went\n> back to sync so I could run \"--verbose\" and see if it was even\n> downloading those changes.  I can clearly see it says it is\n> downloading them, but then they just don't end up in git.\n> \n> Since I don't see an error message about it failing to sync, I am at a\n> loss to figure out why it says it succeeded, but it didn't.  Could\n> there be one step in the code that is not catching an error condition?\n>  I am not all that familiar with Python, but if someone could point me\n> where to put some debug messages, I can do some testing.\n\nIt would say something if it failed.  If git-p4 says it brought\nin changes, they would appear at the top of p4/master, or another\nbranch in remotes/p4 if you use git-p4's auto-branch feature.\n\nDo \"git branch -av\".  You should see remotes/p4/master with the\nlatest p4 change.\n\nIt is possible to create a branch \"p4/master\" that is not\nremotes/p4/master and possibly cause confusion.  \"tree -a\n.git/refs\" to see all your branches.\n\nYou can try \"git fsck\" to see if something is terribly wrong.\nOr nose around .git, see if there are some recently-created\nobjects and use \"git cat-file -p\" to look at them.\n\nIf you are willing to tar up your .git and leave it somewhere,\nI can take a look too.\n\n\t\t-- Pete\n\n> Thanks,\n> \n> Mike\n> \n> \n> \n> On Fri, Apr 15, 2011 at 4:22 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:\n> >\n> > On Fri, Apr 15, 2011 at 5:00 AM, Michael Horowitz\n> > <michael.horowitz@ieee.org> wrote:\n> > > Pete,\n> > >\n> > > I was hoping you could help me out again.  After using git-p4 for a\n> > > while without a problem, it has suddenly stopped working for me.  I am\n> > > using the latest master.  I haven't seen any recent changes that I\n> > > think could have caused this, but maybe you'll have some insight.\n> > >\n> > > The issue is that when I do a git-p4 sync on my existing repository,\n> > > it reports success, but seems to do nothing.  It does not download the\n> > > latest changes from p4.  If I delete my repository and start over, it\n> > > will download all the latest changes, even the ones it was not\n> > > downloading previously, but if I try to sync again later, it does not\n> > > do anything.  I tried running it with the \"--verbose\" mode, and I see\n> > > it says it is loading each of the changes, but they are not ending up\n> > > in the git repository, and it is not reporting any errors.\n> >\n> > Hi, Michael.\n> >\n> > Is it possible that you expect that 'git p4 sync' should update your\n> > working branch and/or working tree? Assuming a simple clone with a\n> > local master branch, running 'git-p4 sync' will update the branch\n> > remotes/p4/master, but it won't do anything on my working master\n> > branch...\n> >\n> > Maybe you want to call 'git rebase p4/master' afterwards, or use the\n> > shorthand 'git p4 rebase' to do a sync+rebase.\n> >\n> > Regards,\n> > Tor Arvid.\n> >\n> > > Any ideas of what this could be?  Is there anything else I can run to\n> > > help debug this?\n> > >\n> > > Thanks,\n> > >\n> > > Mike\n> > > --\n> > > To unsubscribe from this list: send the line \"unsubscribe git\" in\n> > > the body of a message to majordomo@vger.kernel.org\n> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> > >\n> \n"},{"id":"166031","messageId":"loom.20110418T145406-908@post.gmane.org","threadId":"27101","inReplyTo":"20110416160109.GA19557@arf.padd.com","subject":"Re: git-p4 issue","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-04-18T12:59:17Z","receivedAt":"2011-04-18T12:59:17Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Pete and Michael,\n\nPete Wyckoff <pw <at> padd.com> writes:\n\n> \n> michael.horowitz <at> ieee.org wrote on Fri, 15 Apr 2011 16:39 -0400:\n> > I am sure that is a common mistake people make, but not in this case.\n> > I have been using it successfully for a while now, it just suddenly\n> > stopped working, not sure what changed.  I am not seeing anything on\n> > remotes/p4/master either, and I was originally doing rebase and went\n> > back to sync so I could run \"--verbose\" and see if it was even\n> > downloading those changes.  I can clearly see it says it is\n> > downloading them, but then they just don't end up in git.\n\nI've seen similar behavior when branch detection is enabled. Could it be that\nthe new changelists are not being imported because they are under a folder that\nis not part of the path provided to git-p4 sync (or automatically detected by\nit) during the original import? That would explain why --verbose shows the\nchangelists being downloaded but then they are not imported.\n\nYou said that if you clone the depot again you see the new changes. Could you\nplease confirm if \"depot_paths\" value is the same in git-log of both git repos?\n\n> > Since I don't see an error message about it failing to sync, I am at a\n> > loss to figure out why it says it succeeded, but it didn't.  Could\n> > there be one step in the code that is not catching an error condition?\n> >  I am not all that familiar with Python, but if someone could point me\n> > where to put some debug messages, I can do some testing.\n> \n> It would say something if it failed.  If git-p4 says it brought\n> in changes, they would appear at the top of p4/master, or another\n> branch in remotes/p4 if you use git-p4's auto-branch feature.\n> \n> Do \"git branch -av\".  You should see remotes/p4/master with the\n> latest p4 change.\n> \n> It is possible to create a branch \"p4/master\" that is not\n> remotes/p4/master and possibly cause confusion.  \"tree -a\n> .git/refs\" to see all your branches.\n> \n> You can try \"git fsck\" to see if something is terribly wrong.\n> Or nose around .git, see if there are some recently-created\n> objects and use \"git cat-file -p\" to look at them.\n> \n> If you are willing to tar up your .git and leave it somewhere,\n> I can take a look too.\n> \n> \t\t-- Pete\n\n\nVitor\n"},{"id":"166058","messageId":"BANLkTinJecAsXt+5JzscFYEx_ez2q9DioQ@mail.gmail.com","threadId":"27101","inReplyTo":"BANLkTikDDDtyJB992DFNtvgMrGvbWf=rMw@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-04-19T03:57:52Z","receivedAt":"2011-04-19T03:57:52Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"OK, after some digging, I think I have figured out what is going on,\nbut I am not sure how to fix it, at least not safely.\n\nThere seem to be several different ways of detecting branches, and I\nam not exactly sure what they are all used for, or why there are so\nmany, but the core of the issue I am having is that in importChanges\nwhen it calls splitFilesIntoBranches, it assumes \"self.knownBranches\"\nhas all the branches, even though it already has the branches from\n\"self.p4BranchesInGit\".  The exact reason I don't know, but the\nresults is splitFilesIntoBranches returns an empty array, and so when\nthe code loops over it, it silently does nothing.\n\nThe first fix that would be helpful is to at least report an error if\nit can't find the branches, rather than silently doing nothing.  I am\nnot exactly sure why it needs to look in \"self.knownBranches\", so I\ndon't know what the error should report, maybe the error should be\nreported earlier?\n\nThe other issue is how \"self.knownBranches\" seems to be populated.  It\nlooks like form my code path, which decides to \"Import from/to\nmultiple branches\", it tries to detect branches by using \"p4\nbranches\".  Again, this is odd, since I can see it already has the\nnames of the branches from \"self.p4BranchesInGit\".  I am not familiar\nenough with the code (and figuring out Python as I go along) to know\nwhy.  The problem with using \"p4 branches\" is those aren't really\nbranches, they are aliases to a merge command (integrate in p4 lingo)\nwhich stores the from and to branch.  The branch in Perforce is really\njust a directory.  Interestingly enough, it seems this logic also\nattempts to detect new branches and automatically import them, but\nironically this doesn't actually work for me.\n\nSo, the crux of the problem is that \"p4 branches\" are not necessary to\nhave at all.  The reason this suddenly stopped working for me is that\nsomeone had created one of these branch definitions and I didn't know,\nso it was accidentally working all this time, but only for 2 of the\nbranches.  Then the person removed the definition, and it stopped\nworking.  Now the workaround is to go and create these things for\nevery branch, but considering these are unnecessary and cumbersome to\ncreate, and the code seems to be able to find the branches already\nfrom the \"self.p4BranchesInGit\" anyway, I would like to remove the\ndependency on that logic.\n\nNow, I could go ahead and hack something that does things differently,\nbut since I don't really know the intention of these structures or how\nit might impact elsewhere in the code, I could use some guidance from\nsomeone who knows this code well.\n\nThanks,\n\nMike\n\n\n\n\nOn Fri, Apr 15, 2011 at 4:39 PM, Michael Horowitz\n<michael.horowitz@ieee.org> wrote:\n> I am sure that is a common mistake people make, but not in this case.\n> I have been using it successfully for a while now, it just suddenly\n> stopped working, not sure what changed.  I am not seeing anything on\n> remotes/p4/master either, and I was originally doing rebase and went\n> back to sync so I could run \"--verbose\" and see if it was even\n> downloading those changes.  I can clearly see it says it is\n> downloading them, but then they just don't end up in git.\n>\n> Since I don't see an error message about it failing to sync, I am at a\n> loss to figure out why it says it succeeded, but it didn't.  Could\n> there be one step in the code that is not catching an error condition?\n>  I am not all that familiar with Python, but if someone could point me\n> where to put some debug messages, I can do some testing.\n>\n> Thanks,\n>\n> Mike\n>\n>\n>\n> On Fri, Apr 15, 2011 at 4:22 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:\n>>\n>> On Fri, Apr 15, 2011 at 5:00 AM, Michael Horowitz\n>> <michael.horowitz@ieee.org> wrote:\n>> > Pete,\n>> >\n>> > I was hoping you could help me out again.  After using git-p4 for a\n>> > while without a problem, it has suddenly stopped working for me.  I am\n>> > using the latest master.  I haven't seen any recent changes that I\n>> > think could have caused this, but maybe you'll have some insight.\n>> >\n>> > The issue is that when I do a git-p4 sync on my existing repository,\n>> > it reports success, but seems to do nothing.  It does not download the\n>> > latest changes from p4.  If I delete my repository and start over, it\n>> > will download all the latest changes, even the ones it was not\n>> > downloading previously, but if I try to sync again later, it does not\n>> > do anything.  I tried running it with the \"--verbose\" mode, and I see\n>> > it says it is loading each of the changes, but they are not ending up\n>> > in the git repository, and it is not reporting any errors.\n>>\n>> Hi, Michael.\n>>\n>> Is it possible that you expect that 'git p4 sync' should update your\n>> working branch and/or working tree? Assuming a simple clone with a\n>> local master branch, running 'git-p4 sync' will update the branch\n>> remotes/p4/master, but it won't do anything on my working master\n>> branch...\n>>\n>> Maybe you want to call 'git rebase p4/master' afterwards, or use the\n>> shorthand 'git p4 rebase' to do a sync+rebase.\n>>\n>> Regards,\n>> Tor Arvid.\n>>\n>> > Any ideas of what this could be?  Is there anything else I can run to\n>> > help debug this?\n>> >\n>> > Thanks,\n>> >\n>> > Mike\n>> > --\n>> > To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> > the body of a message to majordomo@vger.kernel.org\n>> > More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>> >\n>\n"},{"id":"166076","messageId":"loom.20110419T115354-846@post.gmane.org","threadId":"27101","inReplyTo":"BANLkTinJecAsXt+5JzscFYEx_ez2q9DioQ@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-04-19T09:59:09Z","receivedAt":"2011-04-19T09:59:09Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Mike,\n\nCould you please search for the following set of patches in this mailing list?\n\n[PATCH v2 0/3] git-p4: Improve branch support\n\nI think I sent v2 twice somehow, so please make sure you pick the latest ;)\nIn these patches I add the possibility to use a \"git-p4.branchList\"\nconfiguration to define the branches. The patch is still to be approved because\nmost people in the mailing list do not use branch detection, but I use it daily\nand it is working in my side. Could you please test it?\n\nThanks,\nVitor\n\nP.S. - It's better that you do not apply \"[PATCH v2 1/3] git-p4: Correct branch\nbase depot path detection\", as it may require you to clone the all depot again.\n"},{"id":"166114","messageId":"20110420003100.GC28768@arf.padd.com","threadId":"27101","inReplyTo":"BANLkTinJecAsXt+5JzscFYEx_ez2q9DioQ@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-04-20T00:31:00Z","receivedAt":"2011-04-20T00:31:00Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"michael.horowitz@ieee.org wrote on Mon, 18 Apr 2011 23:57 -0400:\n> OK, after some digging, I think I have figured out what is going on,\n> but I am not sure how to fix it, at least not safely.\n> \n> There seem to be several different ways of detecting branches, and I\n> am not exactly sure what they are all used for, or why there are so\n> many, but the core of the issue I am having is that in importChanges\n> when it calls splitFilesIntoBranches, it assumes \"self.knownBranches\"\n> has all the branches, even though it already has the branches from\n> \"self.p4BranchesInGit\".  The exact reason I don't know, but the\n> results is splitFilesIntoBranches returns an empty array, and so when\n> the code loops over it, it silently does nothing.\n\nI too am confused by the branch handling in git-p4, and have never\nused it.  I'd love to rip it all out, along with the confusion,\nbut know that some people use it with success.\n\nAt least it all could use some overhaul and documentation so we\ncan see what's going on.\n\n> The first fix that would be helpful is to at least report an error if\n> it can't find the branches, rather than silently doing nothing.  I am\n> not exactly sure why it needs to look in \"self.knownBranches\", so I\n> don't know what the error should report, maybe the error should be\n> reported earlier?\n> \n> The other issue is how \"self.knownBranches\" seems to be populated.  It\n> looks like form my code path, which decides to \"Import from/to\n> multiple branches\", it tries to detect branches by using \"p4\n> branches\".  Again, this is odd, since I can see it already has the\n> names of the branches from \"self.p4BranchesInGit\".  I am not familiar\n> enough with the code (and figuring out Python as I go along) to know\n> why.  The problem with using \"p4 branches\" is those aren't really\n> branches, they are aliases to a merge command (integrate in p4 lingo)\n> which stores the from and to branch.  The branch in Perforce is really\n> just a directory.  Interestingly enough, it seems this logic also\n> attempts to detect new branches and automatically import them, but\n> ironically this doesn't actually work for me.\n\nThis is my understanding of \"p4 branch\" as well.  At our site,\nthe list of p4 branches does not at all correspond to what we\nthink of as code development branches in git.  Again, maybe\nothers use it differently?\n\nWe do maintain p4 view lists, but that is kept out-of-band, not\nin any p4 mechanism.  These map friendlier short names to a list\nof directories in p4 and how to assemble those into a workspace.\n\n> So, the crux of the problem is that \"p4 branches\" are not necessary to\n> have at all.  The reason this suddenly stopped working for me is that\n> someone had created one of these branch definitions and I didn't know,\n> so it was accidentally working all this time, but only for 2 of the\n> branches.  Then the person removed the definition, and it stopped\n> working.  Now the workaround is to go and create these things for\n> every branch, but considering these are unnecessary and cumbersome to\n> create, and the code seems to be able to find the branches already\n> from the \"self.p4BranchesInGit\" anyway, I would like to remove the\n> dependency on that logic.\n> \n> Now, I could go ahead and hack something that does things differently,\n> but since I don't really know the intention of these structures or how\n> it might impact elsewhere in the code, I could use some guidance from\n> someone who knows this code well.\n\nVitor uses branches, and his patch that he recommends might be\nthe work-around you are looking for.\n\nI thought all this branch code was opt-in, so if you fail to say\n\"--detect-branches\", it won't try to auto-detect anything.\n\nBut there is maybe another use case in here, which is to\nimport multiple directories of the depot into _different_\nrefs/remotes/p4/<branch>.  (I've only ever done one at a\ntime, and into the default p4/master.)  And now that you\nhave multiple git-p4 branches, you're stuck with them due to the\nlogin in p4BranchesInGit().  That feature should be handled\nindependently of the \"p4 branch\" auto-detection one.\n\nThe branch handling needs rework.  You might help by describing\nhow you want it to work and we can see if this is the same as how\nVitor uses branches.\n\n\t\t-- Pete\n"},{"id":"166116","messageId":"BANLkTikYDR+bzJQGip9BFo-BSgsBqEcQjQ@mail.gmail.com","threadId":"27101","inReplyTo":"20110420003100.GC28768@arf.padd.com","subject":"Re: git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-04-20T02:40:40Z","receivedAt":"2011-04-20T02:40:40Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"I don't have a problem with the branch detection if other people use\nit in ways I don't, but it would be nice to have more options and\ndocumentation around it.\n\nThe best I can do to describe what I want is for it to use what is\nreturned by \"git-p4 branches\", at minimum.  If there is some optional\nadditional \"new branch detection\" logic, I don't have a problem with\nthat, but that should only be in addition to the branches it already\nknows about from \"git-p4 branches\".  So, when I do a \"git-p4 sync\" or\n\"git-p4 rebase\", and it is importing changes from/to multiple\nbranches, then it should get that list of branches using the same\nmethod \"git-p4 branches\" uses.  Does that make sense?\n\nThanks,\n\nMike\n\n\n\nOn Tue, Apr 19, 2011 at 8:31 PM, Pete Wyckoff <pw@padd.com> wrote:\n>\n> michael.horowitz@ieee.org wrote on Mon, 18 Apr 2011 23:57 -0400:\n> > OK, after some digging, I think I have figured out what is going on,\n> > but I am not sure how to fix it, at least not safely.\n> >\n> > There seem to be several different ways of detecting branches, and I\n> > am not exactly sure what they are all used for, or why there are so\n> > many, but the core of the issue I am having is that in importChanges\n> > when it calls splitFilesIntoBranches, it assumes \"self.knownBranches\"\n> > has all the branches, even though it already has the branches from\n> > \"self.p4BranchesInGit\".  The exact reason I don't know, but the\n> > results is splitFilesIntoBranches returns an empty array, and so when\n> > the code loops over it, it silently does nothing.\n>\n> I too am confused by the branch handling in git-p4, and have never\n> used it.  I'd love to rip it all out, along with the confusion,\n> but know that some people use it with success.\n>\n> At least it all could use some overhaul and documentation so we\n> can see what's going on.\n>\n> > The first fix that would be helpful is to at least report an error if\n> > it can't find the branches, rather than silently doing nothing.  I am\n> > not exactly sure why it needs to look in \"self.knownBranches\", so I\n> > don't know what the error should report, maybe the error should be\n> > reported earlier?\n> >\n> > The other issue is how \"self.knownBranches\" seems to be populated.  It\n> > looks like form my code path, which decides to \"Import from/to\n> > multiple branches\", it tries to detect branches by using \"p4\n> > branches\".  Again, this is odd, since I can see it already has the\n> > names of the branches from \"self.p4BranchesInGit\".  I am not familiar\n> > enough with the code (and figuring out Python as I go along) to know\n> > why.  The problem with using \"p4 branches\" is those aren't really\n> > branches, they are aliases to a merge command (integrate in p4 lingo)\n> > which stores the from and to branch.  The branch in Perforce is really\n> > just a directory.  Interestingly enough, it seems this logic also\n> > attempts to detect new branches and automatically import them, but\n> > ironically this doesn't actually work for me.\n>\n> This is my understanding of \"p4 branch\" as well.  At our site,\n> the list of p4 branches does not at all correspond to what we\n> think of as code development branches in git.  Again, maybe\n> others use it differently?\n>\n> We do maintain p4 view lists, but that is kept out-of-band, not\n> in any p4 mechanism.  These map friendlier short names to a list\n> of directories in p4 and how to assemble those into a workspace.\n>\n> > So, the crux of the problem is that \"p4 branches\" are not necessary to\n> > have at all.  The reason this suddenly stopped working for me is that\n> > someone had created one of these branch definitions and I didn't know,\n> > so it was accidentally working all this time, but only for 2 of the\n> > branches.  Then the person removed the definition, and it stopped\n> > working.  Now the workaround is to go and create these things for\n> > every branch, but considering these are unnecessary and cumbersome to\n> > create, and the code seems to be able to find the branches already\n> > from the \"self.p4BranchesInGit\" anyway, I would like to remove the\n> > dependency on that logic.\n> >\n> > Now, I could go ahead and hack something that does things differently,\n> > but since I don't really know the intention of these structures or how\n> > it might impact elsewhere in the code, I could use some guidance from\n> > someone who knows this code well.\n>\n> Vitor uses branches, and his patch that he recommends might be\n> the work-around you are looking for.\n>\n> I thought all this branch code was opt-in, so if you fail to say\n> \"--detect-branches\", it won't try to auto-detect anything.\n>\n> But there is maybe another use case in here, which is to\n> import multiple directories of the depot into _different_\n> refs/remotes/p4/<branch>.  (I've only ever done one at a\n> time, and into the default p4/master.)  And now that you\n> have multiple git-p4 branches, you're stuck with them due to the\n> login in p4BranchesInGit().  That feature should be handled\n> independently of the \"p4 branch\" auto-detection one.\n>\n> The branch handling needs rework.  You might help by describing\n> how you want it to work and we can see if this is the same as how\n> Vitor uses branches.\n>\n>                -- Pete\n"},{"id":"166144","messageId":"loom.20110420T121500-4@post.gmane.org","threadId":"27101","inReplyTo":"BANLkTikYDR+bzJQGip9BFo-BSgsBqEcQjQ@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-04-20T10:51:13Z","receivedAt":"2011-04-20T10:51:13Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Mike,\n\nMichael Horowitz <michael.horowitz <at> ieee.org> writes:\n\n> I don't have a problem with the branch detection if other people use\n> it in ways I don't, but it would be nice to have more options and\n> documentation around it.\n\nYes, documentation is a bit scarce. And looking again at my patch the\ndescription text also does not seem quite good enough.\n\n> The best I can do to describe what I want is for it to use what is\n> returned by \"git-p4 branches\", at minimum. If there is some optional\n> additional \"new branch detection\" logic, I don't have a problem with\n> that, but that should only be in addition to the branches it already\n> knows about from \"git-p4 branches\". So, when I do a \"git-p4 sync\" or\n> \"git-p4 rebase\", and it is importing changes from/to multiple\n> branches, then it should get that list of branches using the same\n> method \"git-p4 branches\" uses. Does that make sense?\n\nI think I understand your point and it may make sense. Currently,\n\"self.knownBranches\" is the list used during import from P4. The idea\nbehind making this list different from \"self.p4BranchesInGit\" might have\nbeen to allow stop following a given branch by removing its definition\nfrom P4. Of course, if you already imported it earlier and there is a\ncommit into it I think it makes sense to import the new commit instead\nof ignoring it as it is being done now. With that said, I think it would\nbe a good idea to somehow merge the two lists together. But, as Pete\nalready pointed out, the branch code is too complex as it is now and it\nneeds a deep review. So it might make sense to include this feature as\npart of that review.\n\nThe patch I directed you to ([1]) allows you to create a list of\nbranch-origin to branch-destination pairs independent of \"p4 branches\"\noutput. So you should be able to use this as a workaround for now.\n\n> Thanks,\n> \n> Mike\n\nRegards,\nVitor\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/168001\n"},{"id":"167279","messageId":"BANLkTik49sCiBnf6ZofrtW+45uR6ZC+C9Q@mail.gmail.com","threadId":"27101","inReplyTo":"BANLkTikYDR+bzJQGip9BFo-BSgsBqEcQjQ@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-05-06T20:16:04Z","receivedAt":"2011-05-06T20:16:04Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"Vitor,\n\n> Could you please search for the following set of patches in this mailing list?\n>\n> [PATCH v2 0/3] git-p4: Improve branch support\n>\n> I think I sent v2 twice somehow, so please make sure you pick the latest ;)\n> In these patches I add the possibility to use a \"git-p4.branchList\"\n> configuration to define the branches. The patch is still to be approved because\n> most people in the mailing list do not use branch detection, but I use it daily\n> and it is working in my side. Could you please test it?\n\nCan you send this patch again?  It looks like you had previously\nresponded to the list only, so I never got this message, as I wasn't\non the list at the time (I am now).  I only saw this because I was\nsearching the archive for something else.  I searched for the patch,\nbut the actual patch body doesn't seem to be in the archive.\n\nThanks,\n\nMike\n\n\n\n\nOn Tue, Apr 19, 2011 at 10:40 PM, Michael Horowitz\n<michael.horowitz@ieee.org> wrote:\n> I don't have a problem with the branch detection if other people use\n> it in ways I don't, but it would be nice to have more options and\n> documentation around it.\n>\n> The best I can do to describe what I want is for it to use what is\n> returned by \"git-p4 branches\", at minimum.  If there is some optional\n> additional \"new branch detection\" logic, I don't have a problem with\n> that, but that should only be in addition to the branches it already\n> knows about from \"git-p4 branches\".  So, when I do a \"git-p4 sync\" or\n> \"git-p4 rebase\", and it is importing changes from/to multiple\n> branches, then it should get that list of branches using the same\n> method \"git-p4 branches\" uses.  Does that make sense?\n>\n> Thanks,\n>\n> Mike\n>\n>\n>\n> On Tue, Apr 19, 2011 at 8:31 PM, Pete Wyckoff <pw@padd.com> wrote:\n>>\n>> michael.horowitz@ieee.org wrote on Mon, 18 Apr 2011 23:57 -0400:\n>> > OK, after some digging, I think I have figured out what is going on,\n>> > but I am not sure how to fix it, at least not safely.\n>> >\n>> > There seem to be several different ways of detecting branches, and I\n>> > am not exactly sure what they are all used for, or why there are so\n>> > many, but the core of the issue I am having is that in importChanges\n>> > when it calls splitFilesIntoBranches, it assumes \"self.knownBranches\"\n>> > has all the branches, even though it already has the branches from\n>> > \"self.p4BranchesInGit\".  The exact reason I don't know, but the\n>> > results is splitFilesIntoBranches returns an empty array, and so when\n>> > the code loops over it, it silently does nothing.\n>>\n>> I too am confused by the branch handling in git-p4, and have never\n>> used it.  I'd love to rip it all out, along with the confusion,\n>> but know that some people use it with success.\n>>\n>> At least it all could use some overhaul and documentation so we\n>> can see what's going on.\n>>\n>> > The first fix that would be helpful is to at least report an error if\n>> > it can't find the branches, rather than silently doing nothing.  I am\n>> > not exactly sure why it needs to look in \"self.knownBranches\", so I\n>> > don't know what the error should report, maybe the error should be\n>> > reported earlier?\n>> >\n>> > The other issue is how \"self.knownBranches\" seems to be populated.  It\n>> > looks like form my code path, which decides to \"Import from/to\n>> > multiple branches\", it tries to detect branches by using \"p4\n>> > branches\".  Again, this is odd, since I can see it already has the\n>> > names of the branches from \"self.p4BranchesInGit\".  I am not familiar\n>> > enough with the code (and figuring out Python as I go along) to know\n>> > why.  The problem with using \"p4 branches\" is those aren't really\n>> > branches, they are aliases to a merge command (integrate in p4 lingo)\n>> > which stores the from and to branch.  The branch in Perforce is really\n>> > just a directory.  Interestingly enough, it seems this logic also\n>> > attempts to detect new branches and automatically import them, but\n>> > ironically this doesn't actually work for me.\n>>\n>> This is my understanding of \"p4 branch\" as well.  At our site,\n>> the list of p4 branches does not at all correspond to what we\n>> think of as code development branches in git.  Again, maybe\n>> others use it differently?\n>>\n>> We do maintain p4 view lists, but that is kept out-of-band, not\n>> in any p4 mechanism.  These map friendlier short names to a list\n>> of directories in p4 and how to assemble those into a workspace.\n>>\n>> > So, the crux of the problem is that \"p4 branches\" are not necessary to\n>> > have at all.  The reason this suddenly stopped working for me is that\n>> > someone had created one of these branch definitions and I didn't know,\n>> > so it was accidentally working all this time, but only for 2 of the\n>> > branches.  Then the person removed the definition, and it stopped\n>> > working.  Now the workaround is to go and create these things for\n>> > every branch, but considering these are unnecessary and cumbersome to\n>> > create, and the code seems to be able to find the branches already\n>> > from the \"self.p4BranchesInGit\" anyway, I would like to remove the\n>> > dependency on that logic.\n>> >\n>> > Now, I could go ahead and hack something that does things differently,\n>> > but since I don't really know the intention of these structures or how\n>> > it might impact elsewhere in the code, I could use some guidance from\n>> > someone who knows this code well.\n>>\n>> Vitor uses branches, and his patch that he recommends might be\n>> the work-around you are looking for.\n>>\n>> I thought all this branch code was opt-in, so if you fail to say\n>> \"--detect-branches\", it won't try to auto-detect anything.\n>>\n>> But there is maybe another use case in here, which is to\n>> import multiple directories of the depot into _different_\n>> refs/remotes/p4/<branch>.  (I've only ever done one at a\n>> time, and into the default p4/master.)  And now that you\n>> have multiple git-p4 branches, you're stuck with them due to the\n>> login in p4BranchesInGit().  That feature should be handled\n>> independently of the \"p4 branch\" auto-detection one.\n>>\n>> The branch handling needs rework.  You might help by describing\n>> how you want it to work and we can see if this is the same as how\n>> Vitor uses branches.\n>>\n>>                -- Pete\n>\n"},{"id":"167804","messageId":"loom.20110513T162233-874@post.gmane.org","threadId":"27101","inReplyTo":"BANLkTik49sCiBnf6ZofrtW+45uR6ZC+C9Q@mail.gmail.com","subject":"Re: git-p4 issue","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-05-13T14:31:32Z","receivedAt":"2011-05-13T14:31:32Z","isPatch":false,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Michael,\n\nMichael Horowitz <michael.horowitz <at> ieee.org> writes:\n\n> \n> Vitor,\n> \n> > Could you please search for the following set of patches in this\n> > mailing list?\n> >\n> > [PATCH v2 0/3] git-p4: Improve branch support\n> >\n> > I think I sent v2 twice somehow, so please make sure you pick the\n> > latest ;)\n> > In these patches I add the possibility to use a \"git-p4.branchList\"\n> > configuration to define the branches. The patch is still to be\n> > approved because most people in the mailing list do not use branch\n> > detection, but I use it daily and it is working in my side. Could\n> > you please test it?\n> \n> Can you send this patch again?  It looks like you had previously\n> responded to the list only, so I never got this message, as I wasn't\n> on the list at the time (I am now).  I only saw this because I was\n> searching the archive for something else.  I searched for the patch,\n> but the actual patch body doesn't seem to be in the archive.\n\nI am also not in the mailing list, I just follow its RSS and try to\nfollow up on the git-p4 related topics ;) That is the reason why you\nwere not included in the reply.\n\nBut I have been a bit busy and did not see this email passing by. Sorry.\nLuckily I had a tab opened in this thread, which I looked at today\nwondering what it was about! :P\n\nPlease follow the link to the thread [1] and you can open each of the\nentries. Take care not to apply patch 1/3 as it may require you to clone\neverything again.\n\n> Thanks,\n> \n> Mike\n> \n\nRegards,\nVitor\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/167998/focus=168000\n"},{"id":"181366","messageId":"CAFLRbooKr4L+xQzzwb-V_ahw8cGz54Q=rPo9QL19NyZQHzxwUw@mail.gmail.com","threadId":"27101","inReplyTo":"loom.20110513T162233-874@post.gmane.org","subject":"Re: git-p4 issue","fromName":"Michael Horowitz","fromEmail":"michael.horowitz@ieee.org","sentAt":"2011-12-17T05:52:57Z","receivedAt":"2011-12-17T05:52:57Z","isPatch":false,"sender":{"key":"michael.horowitz@ieee.org","avatar":null},"body":"Vitor,\n\nI know it has been a long time, but I finally tried the below, and it\nworks for me.  I was doing things wrong at first, but I think I\nfinally understand what is going on...\n\nFirst, the branchList is great, that is what I needed.  Now I can\ncompletely ignore the p4 branches.  It would be great if there was an\noption to not have it query p4 branches at all, because we have so\nmany branches here it takes forever, and I am just using branchList.\nWhat I did for now was to use your branchUser option, and pass it a\nbogus username, like \"XXXXXX\".  At least this way it returns fast, but\nwould be nice to not have it try to query at all.\n\nI think I understand now why all this is needed if you want it to\ndetect branches on its own.  Since in Perforce branches are just\ndirectories, there is no way to tell if a directory is a branch or\nnot, and people could organize branches in an arbitrary directory\nstructure.  I was thinking you could look at sibling directories under\nthe same parent, which may be common, but there is no way to know for\nsure, so better to be explicit.\n\nThe other odd issue is that if you do not add the new branch to\nbranchList (or p4 branches if you are using them) before you do the\ngit-p4 sync, then since it goes through change numbers in order, it\nwill never go back again and catch the branch in a change it already\nsynced.  This is why I could never get it to work, because I never had\nit in place before I synced the relevant change.  What I realized\nthough is that I can always do a \"git-p4 sync --detect-branches\n//depot/foo/bar/@all\" again, even though I already have the most\nrecent change, and it will re-detect any branches I missed (given I\nhave since added them to branchList).\n\nWhat I had been thinking though is that if it had already detected\nbranches once, it could at least update the remote p4 branches it\nalready knew about to point at the latest revision, just not try to\ndetect new ones, and not rely on branchList.  Of course you would\nstill need branchList to detect any new branches.\n\nAnyway, works a lot better than it did before.\n\nThanks,\n\nMike\n\n\nOn Fri, May 13, 2011 at 10:31 AM, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> Hi Michael,\n>\n> Michael Horowitz <michael.horowitz <at> ieee.org> writes:\n>\n>>\n>> Vitor,\n>>\n>> > Could you please search for the following set of patches in this\n>> > mailing list?\n>> >\n>> > [PATCH v2 0/3] git-p4: Improve branch support\n>> >\n>> > I think I sent v2 twice somehow, so please make sure you pick the\n>> > latest ;)\n>> > In these patches I add the possibility to use a \"git-p4.branchList\"\n>> > configuration to define the branches. The patch is still to be\n>> > approved because most people in the mailing list do not use branch\n>> > detection, but I use it daily and it is working in my side. Could\n>> > you please test it?\n>>\n>> Can you send this patch again?  It looks like you had previously\n>> responded to the list only, so I never got this message, as I wasn't\n>> on the list at the time (I am now).  I only saw this because I was\n>> searching the archive for something else.  I searched for the patch,\n>> but the actual patch body doesn't seem to be in the archive.\n>\n> I am also not in the mailing list, I just follow its RSS and try to\n> follow up on the git-p4 related topics ;) That is the reason why you\n> were not included in the reply.\n>\n> But I have been a bit busy and did not see this email passing by. Sorry.\n> Luckily I had a tab opened in this thread, which I looked at today\n> wondering what it was about! :P\n>\n> Please follow the link to the thread [1] and you can open each of the\n> entries. Take care not to apply patch 1/3 as it may require you to clone\n> everything again.\n>\n>> Thanks,\n>>\n>> Mike\n>>\n>\n> Regards,\n> Vitor\n>\n> [1] http://thread.gmane.org/gmane.comp.version-control.git/167998/focus=168000\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}