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

BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.

From
JSJacob Smith <jaroslov@gmail.com>
Date
Apr 27, 2016, 16:15 UTC
Message-ID
<CAMsgv2UXPkxpocjKhoR7HbmubSBnhJPJ3hMq9Jsk2AD0DoCifA@mail.gmail.com>

On OS X, if the local p4 workspace root doesn't exist, then git-p4 can fail on submit. The error message looks like this:

    Synchronizing p4 checkout...
    Git submit failed!
    shell-init: error retrieving current directory: getcwd: cannot
access parent directories: No such file or directory
    fatal: Unable to read current working directory: No such file or directory
    Command failed: ['git', 'rev-list', '--no-merges',
'remotes/p4/master..master']

The problem is in the function 'run()' around line 1957. The logic in the code is:

    1. Detect if the clientPath exists;
    2. If the clientPath doesn't exist, set the 'new_client_dir'
variable to 'True';
    3. chdir() to the clientPath; then,
    4. If 'new_client_dir' is 'True', then p4_sync("...", True).

On my system, the call to `p4 sync -f` leaves the clientPath directory that git-p4 had chdir()'d into an orphan, so the call to 'git rev-list ...' a few lines fails because the call to getcwd() fails (the directory has no parents).

I can make the problem "go away" by moving the location of the call to 'chdir(self.clientPath, is_client_path=True)' after the call to `p4_sync()`, but I'm not sure if that's really fixing the issue, or not.

Thanks! -j.

Next: Stefan Beller
Message 1 of 5 in “BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.”
  1. Jacob SmithApr 27, 2016
  2. Stefan BellerApr 27, 2016
  3. Jacob SmithApr 27, 2016
  4. Stefan BellerApr 27, 2016
  5. Luke DiamandApr 28, 2016

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.