git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [GIT-P4] usage under Windows
@ 2008-02-22  6:44 Maxim Gordienko
  2008-02-27 22:32 ` Marius Storm-Olsen
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Gordienko @ 2008-02-22  6:44 UTC (permalink / raw)
  To: git

Hello!

What are best practices to use git-p4 under windows?
What p4 client should i use, native or cygwin one? Is any special
perforce client configuration required?
What python distribution is preferred, included in cygwin or active python?
Where i need to put imported directory under perforce client' root or
in any other place?

Thank you!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-02-22  6:44 [GIT-P4] usage under Windows Maxim Gordienko
@ 2008-02-27 22:32 ` Marius Storm-Olsen
  2008-02-29 18:48   ` Maxim Gordienko
  0 siblings, 1 reply; 9+ messages in thread
From: Marius Storm-Olsen @ 2008-02-27 22:32 UTC (permalink / raw)
  To: Maxim Gordienko; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]

Maxim Gordienko wrote:
> What are best practices to use git-p4 under windows?
> What p4 client should i use, native or cygwin one? Is any special
> perforce client configuration required?
 > What python distribution is preferred, included in cygwin or active 
python?

Depends on what your system is. Are you using Git under Cygwin or MSys? 
If you're using Cygwin normally, it's probably wise to use the cygwin 
version of perforce too.

Here's what I do:
     1) Use MSys Git. It's faster. (http://code.google.com/p/msysgit/)
     2) Use native Perforce. It's faster.
     3) Get Python from python.org. There's a binary installer.

> Where i need to put imported directory under perforce client' root or
> in any other place?

In perforce create your client spec somewhere where you don't see it. 
You never need to touch these files, but they are needed to be able to 
submit back to the perforce depot, if you need that. For cloning a 
perforce depot, you don't need a checkout (git-p4 used 'p4 print' to get 
the files directly)

Keep in mind to always rebase your patches before submitting back to a 
Perforce depot, since merges can be represented properly. So, a good 
work practice is to
    1) Clone perforce branch
    2) work, work, commit, work, commit...
    3) git p4 rebase
    4) git p4 submit

Good luck!

--
.marius


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-02-27 22:32 ` Marius Storm-Olsen
@ 2008-02-29 18:48   ` Maxim Gordienko
  2008-02-29 21:54     ` Marius Storm-Olsen
  2008-03-01 11:44     ` Tor Arvid Lund
  0 siblings, 2 replies; 9+ messages in thread
From: Maxim Gordienko @ 2008-02-29 18:48 UTC (permalink / raw)
  To: Marius Storm-Olsen; +Cc: git

Thank you, Marius for detailed instructions!
Now everything except submitting back to perforce works like a charm.
Perforce complains about git-p4 checkout is not under it's root

Synchronizing p4 checkout...
executing p4 sync ...
Path 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.

if I move checkout under perforce root git-p4 unable to create patch.
Have you encounter such errors?
Thank you!

On Thu, Feb 28, 2008 at 1:32 AM, Marius Storm-Olsen
<marius@trolltech.com> wrote:
> Maxim Gordienko wrote:
> > What are best practices to use git-p4 under windows?
> > What p4 client should i use, native or cygwin one? Is any special
> > perforce client configuration required?
>  > What python distribution is preferred, included in cygwin or active
> python?
>
> Depends on what your system is. Are you using Git under Cygwin or MSys?
> If you're using Cygwin normally, it's probably wise to use the cygwin
> version of perforce too.
>
> Here's what I do:
>     1) Use MSys Git. It's faster. (http://code.google.com/p/msysgit/)
>     2) Use native Perforce. It's faster.
>     3) Get Python from python.org. There's a binary installer.
>
> > Where i need to put imported directory under perforce client' root or
> > in any other place?
>
> In perforce create your client spec somewhere where you don't see it.
> You never need to touch these files, but they are needed to be able to
> submit back to the perforce depot, if you need that. For cloning a
> perforce depot, you don't need a checkout (git-p4 used 'p4 print' to get
> the files directly)
>
> Keep in mind to always rebase your patches before submitting back to a
> Perforce depot, since merges can be represented properly. So, a good
> work practice is to
>    1) Clone perforce branch
>    2) work, work, commit, work, commit...
>    3) git p4 rebase
>    4) git p4 submit
>
> Good luck!
>
> --
> .marius
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-02-29 18:48   ` Maxim Gordienko
@ 2008-02-29 21:54     ` Marius Storm-Olsen
  2008-03-01  7:41       ` Maxim Gordienko
  2008-03-01 11:44     ` Tor Arvid Lund
  1 sibling, 1 reply; 9+ messages in thread
From: Marius Storm-Olsen @ 2008-02-29 21:54 UTC (permalink / raw)
  To: Maxim Gordienko; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Maxim Gordienko wrote:
> Thank you, Marius for detailed instructions!
> Now everything except submitting back to perforce works like a charm.
> Perforce complains about git-p4 checkout is not under it's root
> 
> Synchronizing p4 checkout...
> executing p4 sync ...
> Path 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.
> 
> if I move checkout under perforce root git-p4 unable to create patch.
> Have you encounter such errors?

Not that I recall..
However, it seems like you are using an older version of git-p4, so try 
just grabbing the latest one 
(http://repo.or.cz/w/git.git?a=blob_plain;f=contrib/fast-import/git-p4;hb=maint) 
and see if that helps you. If it doesn't work maybe you can tell me what 
your p4 client spec looks like?

--
.marius



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-02-29 21:54     ` Marius Storm-Olsen
@ 2008-03-01  7:41       ` Maxim Gordienko
  2008-03-01  9:50         ` Marius Storm-Olsen
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Gordienko @ 2008-03-01  7:41 UTC (permalink / raw)
  To: Marius Storm-Olsen; +Cc: git

No, unfortunately lattest git-p4 does not help. p4 still complain
about location of checkout or unable to apply patch("file(s) not on
client").
My client spec is (p4 itselt is 2007.3)
---
Client:	YOUR-6C9B4BEFA3

Update:	2008/02/22 01:03:06

Access:	2008/03/01 10:32:50

Owner:	foo

Description:
	Created by foo.

Root:	c:\p4

Options:	noallwrite noclobber nocompress unlocked nomodtime normdir

SubmitOptions:	submitunchanged

LineEnd:	local

View:
	//depot/... //YOUR-6C9B4BEFA3/...
---
Thank you!

On Sat, Mar 1, 2008 at 12:54 AM, Marius Storm-Olsen
<marius@trolltech.com> wrote:
> Maxim Gordienko wrote:
> > Thank you, Marius for detailed instructions!
> > Now everything except submitting back to perforce works like a charm.
> > Perforce complains about git-p4 checkout is not under it's root
> >
> > Synchronizing p4 checkout...
> > executing p4 sync ...
> > Path 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.
> >
> > if I move checkout under perforce root git-p4 unable to create patch.
> > Have you encounter such errors?
>
> Not that I recall..
> However, it seems like you are using an older version of git-p4, so try
> just grabbing the latest one
> (http://repo.or.cz/w/git.git?a=blob_plain;f=contrib/fast-import/git-p4;hb=maint)
> and see if that helps you. If it doesn't work maybe you can tell me what
> your p4 client spec looks like?
>
> --
> .marius
>
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-03-01  7:41       ` Maxim Gordienko
@ 2008-03-01  9:50         ` Marius Storm-Olsen
  0 siblings, 0 replies; 9+ messages in thread
From: Marius Storm-Olsen @ 2008-03-01  9:50 UTC (permalink / raw)
  To: Maxim Gordienko; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

Maxim Gordienko wrote:
> No, unfortunately lattest git-p4 does not help. p4 still complain
> about location of checkout or unable to apply patch("file(s) not on
> client").
> My client spec is (p4 itselt is 2007.3)
> ---
> Client:	YOUR-6C9B4BEFA3
> Update:	2008/02/22 01:03:06
> Access:	2008/03/01 10:32:50
> Owner:	foo
> Description:
> 	Created by foo.
> Root:	c:\p4
> Options:	noallwrite noclobber nocompress unlocked nomodtime normdir
> SubmitOptions:	submitunchanged
> LineEnd:	local
> View:
> 	//depot/... //YOUR-6C9B4BEFA3/...

Hmm, odd. The only thing I can think of is that maybe you have the 
client spec set up correctly, but you never initially checked out the 
sources into C:\p4 ?
Try to run
     cd /D C:\ && p4 sync -f ...
manually, and then see if you're able to 'git p4 submit'.

Oh, and why is Perforce reporting
     Path 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.
It seems to me that you're still using the Cygwin version of Perforce, 
is this correct? If so, ensure that you're only using the native 
version. And please try to remove the Cygwin directories from your PATH 
environment variable, so we're sure that Cygwin isn't messing with us 
to. MSys (which the Git Windows port uses) and Cygwin are not that 
compatible.

--
.marius


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-02-29 18:48   ` Maxim Gordienko
  2008-02-29 21:54     ` Marius Storm-Olsen
@ 2008-03-01 11:44     ` Tor Arvid Lund
  2008-03-01 15:53       ` Marius Storm-Olsen
  1 sibling, 1 reply; 9+ messages in thread
From: Tor Arvid Lund @ 2008-03-01 11:44 UTC (permalink / raw)
  To: Maxim Gordienko; +Cc: Marius Storm-Olsen, git

On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:

> Thank you, Marius for detailed instructions!
> Now everything except submitting back to perforce works like a charm.
> Perforce complains about git-p4 checkout is not under it's root
>
> Synchronizing p4 checkout...
> executing p4 sync ...
> Path 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.

I have seen it too. I'm not sure, but it seems to me like even though  
the git-p4 script does a chdir(<perforce_dir>) before calling "p4  
<command> <args>" the chdir is "not seen by" p4 on windows.

I have a patch on my machine where i simply change all the p4 calls,  
like so:

system("p4 sync ...") --> system("p4 sync %s..." % self.clientPath)

This seems to work in all cases, and also in Mac OS X... I can  
probably clean the patch up a bit, and submit it later today or  
tomorrow if you're interested.

      -- Tor Arvid

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-03-01 11:44     ` Tor Arvid Lund
@ 2008-03-01 15:53       ` Marius Storm-Olsen
  2008-03-03 19:24         ` Maxim Gordienko
  0 siblings, 1 reply; 9+ messages in thread
From: Marius Storm-Olsen @ 2008-03-01 15:53 UTC (permalink / raw)
  To: Tor Arvid Lund; +Cc: Maxim Gordienko, git

[-- Attachment #1: Type: text/plain, Size: 1251 bytes --]

Tor Arvid Lund wrote:
> On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:
>> Synchronizing p4 checkout... executing p4 sync ... Path
>> 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.
> 
> I have seen it too. I'm not sure, but it seems to me like even though
> the git-p4 script does a chdir(<perforce_dir>) before calling "p4 
> <command> <args>" the chdir is "not seen by" p4 on windows.
> 
> I have a patch on my machine where i simply change all the p4 calls,
> like so:
> 
> system("p4 sync ...") --> system("p4 sync %s..." % self.clientPath)
> 
> This seems to work in all cases, and also in Mac OS X... I can
> probably clean the patch up a bit, and submit it later today or
> tomorrow if you're interested.

It must mean that you initially didn't have the perforce files synced to 
disk according to you client spec, so the command to 'cd' into the 
perforce directory failed? I think this problem is solved by just doing a
     p4 sync //depot/...
to make sure that all the files exists on disk, before trying the 'git 
p4 submit' again.

git-p4 does not require checked out files to clone from perforce, but 
requires the files to exist on disk to be able to submit back to the depot.

--
.marius


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 187 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [GIT-P4] usage under Windows
  2008-03-01 15:53       ` Marius Storm-Olsen
@ 2008-03-03 19:24         ` Maxim Gordienko
  0 siblings, 0 replies; 9+ messages in thread
From: Maxim Gordienko @ 2008-03-03 19:24 UTC (permalink / raw)
  To: Marius Storm-Olsen; +Cc: git

Marius, thank you for the tip! but unsynced files not the case. Entire
p4 client dir is in sync with depot.
but i found this:
$ p4 edit 1.txt
1.txt - file(s) not on client.

$ p4 revert //depot/main/1.txt
//depot/main/1.txt#21 - was edit, reverted

git-p4 issues command not pointing on existing file (from p4 point of
view). So we just need to issue full path in sync command.

On Sat, Mar 1, 2008 at 6:53 PM, Marius Storm-Olsen <marius@trolltech.com> wrote:
> Tor Arvid Lund wrote:
> > On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:
> >> Synchronizing p4 checkout... executing p4 sync ... Path
> >> 'c:/tmp/p42/main\...' is not under client's root 'c:\p4'.
> >
> > I have seen it too. I'm not sure, but it seems to me like even though
> > the git-p4 script does a chdir(<perforce_dir>) before calling "p4
> > <command> <args>" the chdir is "not seen by" p4 on windows.
> >
> > I have a patch on my machine where i simply change all the p4 calls,
> > like so:
> >
> > system("p4 sync ...") --> system("p4 sync %s..." % self.clientPath)
> >
> > This seems to work in all cases, and also in Mac OS X... I can
> > probably clean the patch up a bit, and submit it later today or
> > tomorrow if you're interested.
>
> It must mean that you initially didn't have the perforce files synced to
> disk according to you client spec, so the command to 'cd' into the
> perforce directory failed? I think this problem is solved by just doing a
>     p4 sync //depot/...
> to make sure that all the files exists on disk, before trying the 'git
> p4 submit' again.
>
> git-p4 does not require checked out files to clone from perforce, but
> requires the files to exist on disk to be able to submit back to the depot.
>
> --
> .marius
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-03-03 19:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22  6:44 [GIT-P4] usage under Windows Maxim Gordienko
2008-02-27 22:32 ` Marius Storm-Olsen
2008-02-29 18:48   ` Maxim Gordienko
2008-02-29 21:54     ` Marius Storm-Olsen
2008-03-01  7:41       ` Maxim Gordienko
2008-03-01  9:50         ` Marius Storm-Olsen
2008-03-01 11:44     ` Tor Arvid Lund
2008-03-01 15:53       ` Marius Storm-Olsen
2008-03-03 19:24         ` Maxim Gordienko

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).