From: Jacob Smith <jaroslov@gmail.com>
To: git@vger.kernel.org
Subject: BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally.
Date: Wed, 27 Apr 2016 11:15:26 -0500 [thread overview]
Message-ID: <CAMsgv2UXPkxpocjKhoR7HbmubSBnhJPJ3hMq9Jsk2AD0DoCifA@mail.gmail.com> (raw)
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 reply other threads:[~2016-04-27 16:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 16:15 Jacob Smith [this message]
2016-04-27 16:28 ` BUG on OSX `git p4 submit` can fail when the workspace root doesn't exist locally Stefan Beller
2016-04-27 18:06 ` Jacob Smith
2016-04-27 20:53 ` Stefan Beller
2016-04-28 7:36 ` Luke Diamand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMsgv2UXPkxpocjKhoR7HbmubSBnhJPJ3hMq9Jsk2AD0DoCifA@mail.gmail.com \
--to=jaroslov@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).