{"thread":{"id":"42156","subject":"BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","startedAt":"2016-04-27T16:15:26Z","lastAt":"2016-04-28T07:36:33Z","messageCount":5,"participants":["Jacob Smith","Stefan Beller","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"284661","messageId":"CAMsgv2UXPkxpocjKhoR7HbmubSBnhJPJ3hMq9Jsk2AD0DoCifA@mail.gmail.com","threadId":"42156","inReplyTo":null,"subject":"BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","fromName":"Jacob Smith","fromEmail":"jaroslov@gmail.com","sentAt":"2016-04-27T16:15:26Z","receivedAt":"2016-04-27T16:15:26Z","isPatch":false,"sender":{"key":"jaroslov@gmail.com","avatar":null},"body":"On OS X, if the local p4 workspace root doesn't exist, then git-p4 can\nfail on submit. The error message looks like this:\n\n    Synchronizing p4 checkout...\n\n    Git submit failed!\n    shell-init: error retrieving current directory: getcwd: cannot\naccess parent directories: No such file or directory\n    fatal: Unable to read current working directory: No such file or directory\n    Command failed: ['git', 'rev-list', '--no-merges',\n'remotes/p4/master..master']\n\nThe problem is in the function 'run()' around line 1957. The logic in\nthe code is:\n\n    1. Detect if the clientPath exists;\n    2. If the clientPath doesn't exist, set the 'new_client_dir'\nvariable to 'True';\n    3. chdir() to the clientPath; then,\n    4. If 'new_client_dir' is 'True', then p4_sync(\"...\", True).\n\nOn my system, the call to `p4 sync -f` leaves the clientPath directory\nthat git-p4 had chdir()'d into an orphan, so the call to 'git rev-list\n...' a few lines fails because the call to getcwd() fails (the\ndirectory has no parents).\n\nI can make the problem \"go away\" by moving the location of the call to\n'chdir(self.clientPath, is_client_path=True)' after the call to\n`p4_sync()`, but I'm not sure if that's really fixing the issue, or\nnot.\n\nThanks!\n-j.\n"},{"id":"284663","messageId":"CAGZ79kZ6rx4UpPmeGjC8TyHKbVd+Y6i1JyEdDzKuF_9rj4c_7g@mail.gmail.com","threadId":"42156","inReplyTo":"CAMsgv2UXPkxpocjKhoR7HbmubSBnhJPJ3hMq9Jsk2AD0DoCifA@mail.gmail.com","subject":"Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-04-27T16:28:55Z","receivedAt":"2016-04-27T16:28:55Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n> On OS X,\n\nDo you use the Git as provided from OS X? In that case you better report the bug\nto Apple, as their version of Git is slightly different (not close on\nupstream, by both\nhaving additional patches as well as not following the upstream closely IIUC).\n"},{"id":"284701","messageId":"CAMsgv2W7mtJpFf6A4MZs-Sbvdof8EdOOP+uiGYudH8LUjNRo8g@mail.gmail.com","threadId":"42156","inReplyTo":"CAGZ79kZ6rx4UpPmeGjC8TyHKbVd+Y6i1JyEdDzKuF_9rj4c_7g@mail.gmail.com","subject":"Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","fromName":"Jacob Smith","fromEmail":"jaroslov@gmail.com","sentAt":"2016-04-27T18:06:53Z","receivedAt":"2016-04-27T18:06:53Z","isPatch":false,"sender":{"key":"jaroslov@gmail.com","avatar":null},"body":"I debugged the issue using the script here:\n    https://github.com/git/git/blob/master/git-p4.py\nI'm not sure how close to the main repo that is.\n\nOn Wed, Apr 27, 2016 at 11:28 AM, Stefan Beller <sbeller@google.com> wrote:\n> On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n>> On OS X,\n>\n> Do you use the Git as provided from OS X? In that case you better report the bug\n> to Apple, as their version of Git is slightly different (not close on\n> upstream, by both\n> having additional patches as well as not following the upstream closely IIUC).\n"},{"id":"284745","messageId":"CAGZ79kZX5H8ddhZQa4r9SPyhAYo=o6gBae3oPCYQ6iNtxXq1Cg@mail.gmail.com","threadId":"42156","inReplyTo":"CAMsgv2W7mtJpFf6A4MZs-Sbvdof8EdOOP+uiGYudH8LUjNRo8g@mail.gmail.com","subject":"Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-04-27T20:53:50Z","receivedAt":"2016-04-27T20:53:50Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Apr 27, 2016 at 11:06 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n> I debugged the issue using the script here:\n>     https://github.com/git/git/blob/master/git-p4.py\n> I'm not sure how close to the main repo that is.\n>\n> On Wed, Apr 27, 2016 at 11:28 AM, Stefan Beller <sbeller@google.com> wrote:\n>> On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n>>> On OS X,\n>>\n>> Do you use the Git as provided from OS X? In that case you better report the bug\n>> to Apple, as their version of Git is slightly different (not close on\n>> upstream, by both\n>> having additional patches as well as not following the upstream closely IIUC).\n\nIn that case, I have cc'd Luke and Lars, who work on p4\n"},{"id":"284776","messageId":"CAE5ih78eGJN2kUjxfhUiKTAMK5rbTGZ-SFp405w2XRL6BDvwHQ@mail.gmail.com","threadId":"42156","inReplyTo":"CAGZ79kZX5H8ddhZQa4r9SPyhAYo=o6gBae3oPCYQ6iNtxXq1Cg@mail.gmail.com","subject":"Re: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2016-04-28T07:36:33Z","receivedAt":"2016-04-28T07:36:33Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 27 April 2016 at 21:53, Stefan Beller <sbeller@google.com> wrote:\n> On Wed, Apr 27, 2016 at 11:06 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n>> I debugged the issue using the script here:\n>>     https://github.com/git/git/blob/master/git-p4.py\n>> I'm not sure how close to the main repo that is.\n>>\n>> On Wed, Apr 27, 2016 at 11:28 AM, Stefan Beller <sbeller@google.com> wrote:\n>>> On Wed, Apr 27, 2016 at 9:15 AM, Jacob Smith <jaroslov@gmail.com> wrote:\n>>>> On OS X,\n>>>\n>>> Do you use the Git as provided from OS X? In that case you better report the bug\n>>> to Apple, as their version of Git is slightly different (not close on\n>>> upstream, by both\n>>> having additional patches as well as not following the upstream closely IIUC).\n>\n> In that case, I have cc'd Luke and Lars, who work on p4\n\nWhich version of p4 are you using?\n\nYour suggested fix looks plausible though. Possibly it needs both\nchdirs() so that \"p4 sync\" will work if the caller is using a\n.p4config file in the p4 client directory to set the P4CLIENT.\n\nThanks!\nLuke\n"}]}