git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-p4 useclientspec broken?
@ 2012-02-14  0:47 Laurent Charrière
  2012-02-14 12:36 ` Pete Wyckoff
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Charrière @ 2012-02-14  0:47 UTC (permalink / raw)
  To: git

Since I've upgraded to 1.7.9 (on OS X Lion, FWIW), git-p4 submit fails 
to apply any patches if I use useclientspec=true when cloning.

My p4 client is as follows:

Client:	malibu
(...)
Root:	/Users/lcharriere/Documents/Perforce/all
(...)
View:
	//sandbox/... //malibu/sandbox/...
	//depot/... //malibu/depot/...

Sequence of steps to reproduce:

$ git p4 clone //sandbox/lcharriere/foo --use-client-spec
$ cd foo && find .
./.git
(...)
./sandbox/lcharriere/foo/.gitignore
./sandbox/lcharriere/foo/foo.py

-- This is new behavior to me, BTW. Previously, I would have seen
./.git
(...)
./.gitignore
./foo.py

$ cat "test" >> sandbox/lcharriere/foo/.gitignore
$ git commit -a -m "test"
git commit -a -m "test"
[master 7398144] test
  1 files changed, 1 insertions(+), 0 deletions(-)
$ git p4 submit
Perforce checkout for depot path //sandbox/lcharriere/foo/ located at 
/Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying 739814457a8faa84dc0bddd830f671569576b177 test

sandbox/lcharriere/foo/.gitignore - file(s) not on client.
error: sandbox/lcharriere/foo/.gitignore: No such file or directory
Unfortunately applying the change failed!
What do you want to do?
[s]kip this patch / [a]pply the patch forcibly and with .rej files / 
[w]rite the patch to a file (patch.txt)


I tried to follow what's going on with pdb:
* self.depotPath is //sandbox/lcharriere/foo, so git-p4 chdir's to 
/Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/
* In P4Submit.applyCommit, line 926 is:
p4_edit(path)
At this point path is 'sandbox/lcharriere/foo/.gitignore'

I'm guessing this is why the p4 executable doesn't find it. The path 
should be .gitignore. Is it possible that the new behavior I mentioned 
above of reproducing the depot hierarchy when useclientspec is true is 
having unintended side effects, or is a bug?

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

* Re: git-p4 useclientspec broken?
  2012-02-14  0:47 git-p4 useclientspec broken? Laurent Charrière
@ 2012-02-14 12:36 ` Pete Wyckoff
  2012-02-14 23:25   ` Laurent Charrière
  0 siblings, 1 reply; 3+ messages in thread
From: Pete Wyckoff @ 2012-02-14 12:36 UTC (permalink / raw)
  To: Laurent Charrière; +Cc: git

lcharriere@promptu.com wrote on Mon, 13 Feb 2012 16:47 -0800:
> Since I've upgraded to 1.7.9 (on OS X Lion, FWIW), git-p4 submit
> fails to apply any patches if I use useclientspec=true when cloning.
> 
> My p4 client is as follows:
> 
> Client:	malibu
> (...)
> Root:	/Users/lcharriere/Documents/Perforce/all
> (...)
> View:
> 	//sandbox/... //malibu/sandbox/...
> 	//depot/... //malibu/depot/...
> 
> Sequence of steps to reproduce:
> 
> $ git p4 clone //sandbox/lcharriere/foo --use-client-spec
> $ cd foo && find .
> ./.git
> (...)
> ./sandbox/lcharriere/foo/.gitignore
> ./sandbox/lcharriere/foo/foo.py
> 
> -- This is new behavior to me, BTW. Previously, I would have seen
> ./.git
> (...)
> ./.gitignore
> ./foo.py

I did try to clean up our handling of --use-client-spec.  This
behavior was done on purpose, but maybe I didn't the implications
on people who were relying on the old way.  In particular the
behavior of multi-line view specs and those with + and - was
largely unpredictable.

The client spec now has absolute control over what files get put
where in the git repo, just like in p4.  The argument
"//sandbox/lcharriere/foo" in your clone command limits the scope
of what is checked out, but does not affect where it is placed.

You can get the git layout you expect with this view:

    //sandbox/lcharriere/foo/... //malibu/...

or simply just don't use --use-client-spec at all:

    git p4 clone //sandbox/lcharriere/foo

Is this new behavior bad for you?  Suggestions welcome.

> $ cat "test" >> sandbox/lcharriere/foo/.gitignore
> $ git commit -a -m "test"
> git commit -a -m "test"
> [master 7398144] test
>  1 files changed, 1 insertions(+), 0 deletions(-)
> $ git p4 submit
> Perforce checkout for depot path //sandbox/lcharriere/foo/ located
> at /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/
> Synchronizing p4 checkout...
> ... - file(s) up-to-date.
> Applying 739814457a8faa84dc0bddd830f671569576b177 test
> 
> sandbox/lcharriere/foo/.gitignore - file(s) not on client.
> error: sandbox/lcharriere/foo/.gitignore: No such file or directory
> Unfortunately applying the change failed!
> What do you want to do?
> [s]kip this patch / [a]pply the patch forcibly and with .rej files /
> [w]rite the patch to a file (patch.txt)

This is definitely a bug.  I reproduced a similar problem.

> I tried to follow what's going on with pdb:
> * self.depotPath is //sandbox/lcharriere/foo, so git-p4 chdir's to
> /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/
> * In P4Submit.applyCommit, line 926 is:
> p4_edit(path)
> At this point path is 'sandbox/lcharriere/foo/.gitignore'

The path should be plain old ".gitignore", as you noticed.

> I'm guessing this is why the p4 executable doesn't find it. The path
> should be .gitignore. Is it possible that the new behavior I
> mentioned above of reproducing the depot hierarchy when
> useclientspec is true is having unintended side effects, or is a
> bug?

I'll get a patch out tonight or soon.  Need to do gobs of testing
on the submit path to make sure nothing else is broken.

		-- Pete

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

* Re: git-p4 useclientspec broken?
  2012-02-14 12:36 ` Pete Wyckoff
@ 2012-02-14 23:25   ` Laurent Charrière
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Charrière @ 2012-02-14 23:25 UTC (permalink / raw)
  To: Pete Wyckoff; +Cc: git

On 2/14/12 4:36 AM, Pete Wyckoff wrote:
> lcharriere@promptu.com wrote on Mon, 13 Feb 2012 16:47 -0800:
>> $ git p4 clone //sandbox/lcharriere/foo --use-client-spec
>> $ cd foo&&  find .
>> ./.git
>> (...)
>> ./sandbox/lcharriere/foo/.gitignore
>> ./sandbox/lcharriere/foo/foo.py
>>
>> -- This is new behavior to me, BTW. Previously, I would have seen
>> ./.git
>> (...)
>> ./.gitignore
>> ./foo.py
>
...
>
> The client spec now has absolute control over what files get put
> where in the git repo, just like in p4.  The argument
> "//sandbox/lcharriere/foo" in your clone command limits the scope
> of what is checked out, but does not affect where it is placed.
>
...
>
> Is this new behavior bad for you?  Suggestions welcome.

I like the new behavior just fine. I think it's more consistent with how 
p4 operates. I just wanted to point out the change in behavior, because 
I had not seen it called out, and it seemed relevant to my bug report.
The only disadvantage of the new behavior, IMHO, is the associated 
transition. When If you have an 'old-style' repo and do a git p4 rebase 
with 1.7.9, you find yourself in a situation where files are in two 
location, e.g. ./gitignore and ./sandbox/lcharriere/foo/.gitignore. So 
really you need to re-clone from p4. Not a big deal, but it is a little 
surprising.

>> $ cat "test">>  sandbox/lcharriere/foo/.gitignore
>> $ git commit -a -m "test"
>> git commit -a -m "test"
>> [master 7398144] test
>>   1 files changed, 1 insertions(+), 0 deletions(-)
>> $ git p4 submit
>> Perforce checkout for depot path //sandbox/lcharriere/foo/ located
>> at /Users/lcharriere/Documents/Perforce/all/sandbox/lcharriere/foo/
>> Synchronizing p4 checkout...
>> ... - file(s) up-to-date.
>> Applying 739814457a8faa84dc0bddd830f671569576b177 test
>>
>> sandbox/lcharriere/foo/.gitignore - file(s) not on client.
>> error: sandbox/lcharriere/foo/.gitignore: No such file or directory
>> Unfortunately applying the change failed!
>> What do you want to do?
>> [s]kip this patch / [a]pply the patch forcibly and with .rej files /
>> [w]rite the patch to a file (patch.txt)
>
> This is definitely a bug.  I reproduced a similar problem.
>
...
> I'll get a patch out tonight or soon.  Need to do gobs of testing
> on the submit path to make sure nothing else is broken.

Thanks, I appreciate your prompt reply.

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

end of thread, other threads:[~2012-02-14 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14  0:47 git-p4 useclientspec broken? Laurent Charrière
2012-02-14 12:36 ` Pete Wyckoff
2012-02-14 23:25   ` Laurent Charrière

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).