{"thread":{"id":"29620","subject":"git-p4 useclientspec broken?","startedAt":"2012-02-14T00:47:00Z","lastAt":"2012-02-14T23:25:44Z","messageCount":3,"participants":["Laurent Charrière","Pete Wyckoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"184630","messageId":"4F39AF04.5080607@promptu.com","threadId":"29620","inReplyTo":null,"subject":"git-p4 useclientspec broken?","fromName":"Laurent Charrière","fromEmail":"lcharriere@promptu.com","sentAt":"2012-02-14T00:47:00Z","receivedAt":"2012-02-14T00:47:00Z","isPatch":false,"sender":{"key":"lcharriere@promptu.com","avatar":null},"body":"Since I've upgraded to 1.7.9 (on OS X Lion, FWIW), git-p4 submit fails \nto apply any patches if I use useclientspec=true when cloning.\n\nMy p4 client is as follows:\n\nClient:\tmalibu\n(...)\nRoot:\t/Users/lcharriere/Documents/Perforce/all\n(...)\nView:\n\t//sandbox/... //malibu/sandbox/...\n\t//depot/... //malibu/depot/...\n\nSequence of steps to reproduce:\n\n$ git p4 clone //sandbox/lcharriere/foo --use-client-spec\n$ cd foo && find .\n./.git\n(...)\n./sandbox/lcharriere/foo/.gitignore\n./sandbox/lcharriere/foo/foo.py\n\n-- This is new behavior to me, BTW. Previously, I would have seen\n./.git\n(...)\n./.gitignore\n./foo.py\n\n$ cat \"test\" >> sandbox/lcharriere/foo/.gitignore\n$ git commit -a -m \"test\"\ngit commit -a -m \"test\"\n[master 7398144] test\n  1 files changed, 1 insertions(+), 0 deletions(-)\n$ git p4 submit\nPerforce checkout for depot path //sandbox/lcharriere/foo/ located at \n/Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/\nSynchronizing p4 checkout...\n... - file(s) up-to-date.\nApplying 739814457a8faa84dc0bddd830f671569576b177 test\n\nsandbox/lcharriere/foo/.gitignore - file(s) not on client.\nerror: sandbox/lcharriere/foo/.gitignore: No such file or directory\nUnfortunately applying the change failed!\nWhat do you want to do?\n[s]kip this patch / [a]pply the patch forcibly and with .rej files / \n[w]rite the patch to a file (patch.txt)\n\n\nI tried to follow what's going on with pdb:\n* self.depotPath is //sandbox/lcharriere/foo, so git-p4 chdir's to \n/Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/\n* In P4Submit.applyCommit, line 926 is:\np4_edit(path)\nAt this point path is 'sandbox/lcharriere/foo/.gitignore'\n\nI'm guessing this is why the p4 executable doesn't find it. The path \nshould be .gitignore. Is it possible that the new behavior I mentioned \nabove of reproducing the depot hierarchy when useclientspec is true is \nhaving unintended side effects, or is a bug?\n"},{"id":"184655","messageId":"20120214123632.GA5285@padd.com","threadId":"29620","inReplyTo":"4F39AF04.5080607@promptu.com","subject":"Re: git-p4 useclientspec broken?","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-02-14T12:36:32Z","receivedAt":"2012-02-14T12:36:32Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"lcharriere@promptu.com wrote on Mon, 13 Feb 2012 16:47 -0800:\n> Since I've upgraded to 1.7.9 (on OS X Lion, FWIW), git-p4 submit\n> fails to apply any patches if I use useclientspec=true when cloning.\n> \n> My p4 client is as follows:\n> \n> Client:\tmalibu\n> (...)\n> Root:\t/Users/lcharriere/Documents/Perforce/all\n> (...)\n> View:\n> \t//sandbox/... //malibu/sandbox/...\n> \t//depot/... //malibu/depot/...\n> \n> Sequence of steps to reproduce:\n> \n> $ git p4 clone //sandbox/lcharriere/foo --use-client-spec\n> $ cd foo && find .\n> ./.git\n> (...)\n> ./sandbox/lcharriere/foo/.gitignore\n> ./sandbox/lcharriere/foo/foo.py\n> \n> -- This is new behavior to me, BTW. Previously, I would have seen\n> ./.git\n> (...)\n> ./.gitignore\n> ./foo.py\n\nI did try to clean up our handling of --use-client-spec.  This\nbehavior was done on purpose, but maybe I didn't the implications\non people who were relying on the old way.  In particular the\nbehavior of multi-line view specs and those with + and - was\nlargely unpredictable.\n\nThe client spec now has absolute control over what files get put\nwhere in the git repo, just like in p4.  The argument\n\"//sandbox/lcharriere/foo\" in your clone command limits the scope\nof what is checked out, but does not affect where it is placed.\n\nYou can get the git layout you expect with this view:\n\n    //sandbox/lcharriere/foo/... //malibu/...\n\nor simply just don't use --use-client-spec at all:\n\n    git p4 clone //sandbox/lcharriere/foo\n\nIs this new behavior bad for you?  Suggestions welcome.\n\n> $ cat \"test\" >> sandbox/lcharriere/foo/.gitignore\n> $ git commit -a -m \"test\"\n> git commit -a -m \"test\"\n> [master 7398144] test\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> $ git p4 submit\n> Perforce checkout for depot path //sandbox/lcharriere/foo/ located\n> at /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/\n> Synchronizing p4 checkout...\n> ... - file(s) up-to-date.\n> Applying 739814457a8faa84dc0bddd830f671569576b177 test\n> \n> sandbox/lcharriere/foo/.gitignore - file(s) not on client.\n> error: sandbox/lcharriere/foo/.gitignore: No such file or directory\n> Unfortunately applying the change failed!\n> What do you want to do?\n> [s]kip this patch / [a]pply the patch forcibly and with .rej files /\n> [w]rite the patch to a file (patch.txt)\n\nThis is definitely a bug.  I reproduced a similar problem.\n\n> I tried to follow what's going on with pdb:\n> * self.depotPath is //sandbox/lcharriere/foo, so git-p4 chdir's to\n> /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/\n> * In P4Submit.applyCommit, line 926 is:\n> p4_edit(path)\n> At this point path is 'sandbox/lcharriere/foo/.gitignore'\n\nThe path should be plain old \".gitignore\", as you noticed.\n\n> I'm guessing this is why the p4 executable doesn't find it. The path\n> should be .gitignore. Is it possible that the new behavior I\n> mentioned above of reproducing the depot hierarchy when\n> useclientspec is true is having unintended side effects, or is a\n> bug?\n\nI'll get a patch out tonight or soon.  Need to do gobs of testing\non the submit path to make sure nothing else is broken.\n\n\t\t-- Pete\n"},{"id":"184730","messageId":"4F3AED78.7010500@promptu.com","threadId":"29620","inReplyTo":"20120214123632.GA5285@padd.com","subject":"Re: git-p4 useclientspec broken?","fromName":"Laurent Charrière","fromEmail":"lcharriere@promptu.com","sentAt":"2012-02-14T23:25:44Z","receivedAt":"2012-02-14T23:25:44Z","isPatch":false,"sender":{"key":"lcharriere@promptu.com","avatar":null},"body":"On 2/14/12 4:36 AM, Pete Wyckoff wrote:\n> lcharriere@promptu.com wrote on Mon, 13 Feb 2012 16:47 -0800:\n>> $ git p4 clone //sandbox/lcharriere/foo --use-client-spec\n>> $ cd foo&&  find .\n>> ./.git\n>> (...)\n>> ./sandbox/lcharriere/foo/.gitignore\n>> ./sandbox/lcharriere/foo/foo.py\n>>\n>> -- This is new behavior to me, BTW. Previously, I would have seen\n>> ./.git\n>> (...)\n>> ./.gitignore\n>> ./foo.py\n>\n...\n>\n> The client spec now has absolute control over what files get put\n> where in the git repo, just like in p4.  The argument\n> \"//sandbox/lcharriere/foo\" in your clone command limits the scope\n> of what is checked out, but does not affect where it is placed.\n>\n...\n>\n> Is this new behavior bad for you?  Suggestions welcome.\n\nI like the new behavior just fine. I think it's more consistent with how \np4 operates. I just wanted to point out the change in behavior, because \nI had not seen it called out, and it seemed relevant to my bug report.\nThe only disadvantage of the new behavior, IMHO, is the associated \ntransition. When If you have an 'old-style' repo and do a git p4 rebase \nwith 1.7.9, you find yourself in a situation where files are in two \nlocation, e.g. ./gitignore and ./sandbox/lcharriere/foo/.gitignore. So \nreally you need to re-clone from p4. Not a big deal, but it is a little \nsurprising.\n\n>> $ cat \"test\">>  sandbox/lcharriere/foo/.gitignore\n>> $ git commit -a -m \"test\"\n>> git commit -a -m \"test\"\n>> [master 7398144] test\n>>   1 files changed, 1 insertions(+), 0 deletions(-)\n>> $ git p4 submit\n>> Perforce checkout for depot path //sandbox/lcharriere/foo/ located\n>> at /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/\n>> Synchronizing p4 checkout...\n>> ... - file(s) up-to-date.\n>> Applying 739814457a8faa84dc0bddd830f671569576b177 test\n>>\n>> sandbox/lcharriere/foo/.gitignore - file(s) not on client.\n>> error: sandbox/lcharriere/foo/.gitignore: No such file or directory\n>> Unfortunately applying the change failed!\n>> What do you want to do?\n>> [s]kip this patch / [a]pply the patch forcibly and with .rej files /\n>> [w]rite the patch to a file (patch.txt)\n>\n> This is definitely a bug.  I reproduced a similar problem.\n>\n...\n> I'll get a patch out tonight or soon.  Need to do gobs of testing\n> on the submit path to make sure nothing else is broken.\n\nThanks, I appreciate your prompt reply.\n"}]}