Skip to contentSkip to conversation

git-p4 submit, Can't clobber writable file

DISCUSSION Gary Yang 4 participants 8 messages Jun 15, 2016

lore
Share & tools
lore

Gary Yang

author
#0 lore raw

I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

from sets import Set;
Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/ Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c
......
command failed: p4 sync ...

Thanks.

#1 lore raw
Quoted 12 lines · Gary Yang

I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

Quoted 9 lines

from sets import Set;
Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/ Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c
......
command failed: p4 sync ...

You might want to clone to a git working dir different than the p4 working dir.

For instance, if your p4 workspace has the working dir set to build_scripts/, try 'git p4 clone //build/scripts build_scripts.git'.

You would then normally work under build_scripts.git/. build_scripts/ would only be used by git-p4 at submission time.

Cheers.

Signature · 1 line
Jing Xue
author
#2 lore raw

So, I have to keep two copies of source tree at my home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts. Then, p4 submit code into Perforce. Is this the only way of using git-p4?
Note: I cannot use git-p4 submit at build_scripts. It claims "Cannot clobber writable file". Is it a bug of git-p4 or the instruction is not correct?

Quoted 50 lines · Jing Xue

From: Jing Xue <[email protected]>
Subject: Re: git-p4 submit, Can't clobber writable file
To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Tuesday, December 2, 2008, 7:07 PM

Quoted 2 lines · Gary Yang

I followed the instructions at

http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

Quoted 10 lines

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

Quoted 2 lines

from sets import Set;
Perforce checkout for depot path //build/scripts/

located at /home/gyang/workspace/build_scripts/

Quoted 2 lines

Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

Can't clobber writable file

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

//build/scripts/foo.c#1 - added as

/home/gyang/workspace/build_scripts/foo.c

Quoted 1 line

Can't clobber writable file

/user/home/gyang/workspace/build_scripts/foo.c

Quoted 2 lines

......
command failed: p4 sync ...

You might want to clone to a git working dir different than the p4
working dir.

For instance, if your p4 workspace has the working dir set to
build_scripts/, try 'git p4 clone //build/scripts build_scripts.git'.

You would then normally work under build_scripts.git/. build_scripts/
would only be used by git-p4 at submission time.

Cheers.

Signature · 1 line
Jing Xue
#3 lore raw

I would argue that's a bug with git-p4, however that is a warning given by perforce, thus, you should be able to work around it by changing the clientspec, change the clientspec so that it will clobber such files, you will need to refer to the perforce docs for info about that.

Quoted 63 lines · Gary Yang

So, I have to keep two copies of source tree at my home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts. Then, p4 submit code into Perforce. Is this the only way of using git-p4?
Note: I cannot use git-p4 submit at build_scripts. It claims "Cannot clobber writable file". Is it a bug of git-p4 or the instruction is not correct?

Quoted 43 lines · Jing Xue

From: Jing Xue <[email protected]>
Subject: Re: git-p4 submit, Can't clobber writable file
To: "Gary Yang" <[email protected]>
Cc: [email protected]
Date: Tuesday, December 2, 2008, 7:07 PM

Quoted 2 lines · Gary Yang

I followed the instructions at

http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

Quoted 10 lines

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

Quoted 2 lines

from sets import Set;
Perforce checkout for depot path //build/scripts/

located at /home/gyang/workspace/build_scripts/

Quoted 2 lines

Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

Can't clobber writable file

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

//build/scripts/foo.c#1 - added as

/home/gyang/workspace/build_scripts/foo.c

Quoted 1 line

Can't clobber writable file

/user/home/gyang/workspace/build_scripts/foo.c

Quoted 2 lines

......
command failed: p4 sync ...

You might want to clone to a git working dir different than the p4
working dir.

For instance, if your p4 workspace has the working dir set to
build_scripts/, try 'git p4 clone //build/scripts build_scripts.git'.

Quoted 7 lines

You would then normally work under build_scripts.git/. build_scripts/
would only be used by git-p4 at submission time.

Cheers.

Signature · 1 line
Jing Xue

--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw

Arafangion,

I got email from Jing and I solved the problem. The doc should clearly state that we need a separated P4 working dir in order to make git p4 submit work. Many thanks to Jing.

Gary

Quoted 106 lines · Arafangion

From: Arafangion <[email protected]>
Subject: Re: git-p4 submit, Can't clobber writable file
To: [email protected]
Cc: "Jing Xue" <[email protected]>, [email protected]
Date: Wednesday, December 3, 2008, 3:07 AM
I would argue that's a bug with git-p4, however that is a warning given
by perforce, thus, you should be able to work around it by changing the
clientspec, change the clientspec so that it will clobber such files,
you will need to refer to the perforce docs for info about that.

Quoted 1 line · Gary Yang

So, I have to keep two copies of source tree at my

home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts. Then, p4 submit code into Perforce. Is this the only way of using git-p4?

Quoted 1 line

Note: I cannot use git-p4 submit at build_scripts. It

claims "Cannot clobber writable file". Is it a bug of git-p4 or the instruction is not correct?

Quoted 3 lines

--- On Tue, 12/2/08, Jing Xue

Quoted 3 lines · <[email protected]> wrote:
Quoted 3 lines

From: Jing Xue <[email protected]>
Subject: Re: git-p4 submit, Can't clobber

writable file

Quoted 1 line
Quoted 1 line

To: "Gary Yang"

<[email protected]>

Quoted 3 lines
Quoted 3 lines

Cc: [email protected]
Date: Tuesday, December 2, 2008, 7:07 PM
On Tue, Dec 02, 2008 at 02:30:51PM -0800, Gary

Quoted 3 lines · Yang
Quoted 3 lines
Quoted 2 lines

I followed the instructions at

http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

But, I am not able to git-p4 submit. Any

idea?

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

from sets import Set;
Perforce checkout for depot path

//build/scripts/

Quoted 6 lines
Quoted 6 lines

located at /home/gyang/workspace/build_scripts/

Quoted 2 lines

Syncronizing p4 checkout...
//build/scripts/foo.h#1 - added as

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

Can't clobber writable file

/home/gyang/workspace/build_scripts/foo.h

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

//build/scripts/foo.c#1 - added as

/home/gyang/workspace/build_scripts/foo.c

Quoted 1 line

Can't clobber writable file

/user/home/gyang/workspace/build_scripts/foo.c

Quoted 2 lines

......
command failed: p4 sync ...

You might want to clone to a git working dir

different than

Quoted 4 lines
Quoted 4 lines

the p4
working dir.

For instance, if your p4 workspace has the

working dir set

Quoted 2 lines
Quoted 2 lines

to
build_scripts/, try 'git p4 clone

//build/scripts

Quoted 3 lines
Quoted 3 lines

build_scripts.git'.

You would then normally work under

build_scripts.git/.

Quoted 11 lines
Quoted 6 lines

build_scripts/
would only be used by git-p4 at submission time.

Cheers.

Signature · 1 line
Jing Xue

--
To unsubscribe from this list: send the line

"unsubscribe git" in

Quoted 2 lines

the body of a message to [email protected] More majordomo info at

http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Gary Yang

(Just a friendly reminder - I believe the convention on this list is "no top-post.")

Quoted 16 lines · Gary Yang
Quoted 4 lines · Jing Xue

You might want to clone to a git working dir different than the p4
working dir.

Quoted 8 lines

For instance, if your p4 workspace has the working dir set to
build_scripts/, try 'git p4 clone //build/scripts build_scripts.git'.

You would then normally work under build_scripts.git/. build_scripts/
would only be used by git-p4 at submission time.

Quoted 5 lines

So, I have to keep two copies of source tree at my home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts.

You don't have to do that, not manually. That's git-p4's job. When you do 'git p4 submit', it basically:

1. calls 'p4 sync' in the p4 working dir,
2. generates patches from p4/master..HEAD,
3. for each of the patches, applies it in the p4 working dir, and 'p4 submit' it as one changelist.

Quoted 4 lines

Then, p4 submit code into
Perforce. Is this the only way of using git-p4? Note: I cannot use git-p4 submit at build_scripts. It claims "Cannot clobber writable file". Is it a bug of git-p4 or the instruction is not correct?

Git-p4.txt does mention this (although briefly) in the "Submitting" section:

"git-p4 has support for submitting changes from a git repository back to the Perforce depot. This requires a Perforce checkout separate from your git repository..."

Cheers.

Signature · 1 line
Jing Xue
#6 lore raw
In reply to Gary Yang

2008/12/2 Gary Yang <[email protected]>:

Quoted 12 lines

I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

Quoted 3 lines

from sets import Set;
Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/ Syncronizing p4 checkout...

This will be running a p4 sync ... command to ensure that the files are up-to-date.

Quoted 6 lines

//build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c
......
command failed: p4 sync ...

Perforce will mark files as readonly when it does a checkout. When you use p4 edit to say you have made changes to the file, Perforce removes the readonly bit.

What is happening here is that the sync (checkout) command is trying to write foo.h/c to your build_scripts directory, but because they already exist there *and* are not readonly, Perforce is producing that error as it does not want to overwrite any files that have changed locally.

Not sure what is happening on the git-p4 side, though.

- Reece

author
#7 lore raw

Reece,

I understand your explanation. But, git-p4 submit does not work for me. Are you able to re-produce the problem?

Thanks,

Gary

Quoted 58 lines · Reece Dunn

From: Reece Dunn <[email protected]>
Subject: Re: git-p4 submit, Can't clobber writable file
To: [email protected]
Cc: [email protected]
Date: Tuesday, December 2, 2008, 3:51 PM 2008/12/2 Gary Yang <[email protected]>:

Quoted 2 lines

I followed the instructions at

http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt

Quoted 10 lines

But, I am not able to git-p4 submit. Any idea?

git-p4 clone //build/scripts build_scripts
cd build_scripts
vi foo.h
git commit foo.h
git-p4 rebase
git-p4 submit

Quoted 2 lines

from sets import Set;
Perforce checkout for depot path //build/scripts/

located at /home/gyang/workspace/build_scripts/

Quoted 1 line

Syncronizing p4 checkout...

This will be running a p4 sync ... command to ensure that the files
are up-to-date.

Quoted 1 line

//build/scripts/foo.h#1 - added as

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

Can't clobber writable file

/home/gyang/workspace/build_scripts/foo.h

Quoted 1 line

//build/scripts/foo.c#1 - added as

/home/gyang/workspace/build_scripts/foo.c

Quoted 1 line

Can't clobber writable file

/user/home/gyang/workspace/build_scripts/foo.c

Quoted 2 lines

......
command failed: p4 sync ...

Perforce will mark files as readonly when it does a checkout. When you
use p4 edit to say you have made changes to the file, Perforce
removes the readonly bit.

What is happening here is that the sync (checkout) command is trying
to write foo.h/c to your build_scripts directory, but because they
already exist there *and* are not readonly, Perforce is producing that
error as it does not want to overwrite any files that have changed
locally.

Not sure what is happening on the git-p4 side, though.

- Reece