git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-p4: cloning with a change number does not import all files
@ 2017-11-25 20:35 Patrick Rouleau
  2017-11-27 12:52 ` Lars Schneider
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Rouleau @ 2017-11-25 20:35 UTC (permalink / raw)
  To: git

Hi,

I created a git repository with these commands:
  git p4 clone //perforce/path@123456 repo
  cd repo
  git p4 rebase

Some files created before the change 123456 do not exist in git
history. I do see why,
but those files were not modified after that change number.

If I use "git p4 sync --detect-branches" instead of "git p4 rebase",
the branch contains
all the files, but not the main trunk, and they appear to be added in
the first commit of
the branch.

To avoid the problem, I must clone with "@all" or with the change number when
//perforce/path was created, which is significantly longer.

Regards,
P. Rouleau

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

* Re: git-p4: cloning with a change number does not import all files
  2017-11-25 20:35 git-p4: cloning with a change number does not import all files Patrick Rouleau
@ 2017-11-27 12:52 ` Lars Schneider
  2017-11-29  3:48   ` Patrick Rouleau
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Schneider @ 2017-11-27 12:52 UTC (permalink / raw)
  To: Patrick Rouleau; +Cc: git


> On 25 Nov 2017, at 21:35, Patrick Rouleau <prouleau72@gmail.com> wrote:
> 
> Hi,
> 
> I created a git repository with these commands:
>  git p4 clone //perforce/path@123456 repo
>  cd repo
>  git p4 rebase
> 
> Some files created before the change 123456 do not exist in git
> history. I do see why,
> but those files were not modified after that change number.
> 
> If I use "git p4 sync --detect-branches" instead of "git p4 rebase",
> the branch contains
> all the files, but not the main trunk, and they appear to be added in
> the first commit of
> the branch.
> 
> To avoid the problem, I must clone with "@all" or with the change number when
> //perforce/path was created, which is significantly longer.
> 
> Regards,
> P. Rouleau

Hi Patrick,

what is your goal here? Do you want to convert the repo to Git or do you
want to use Git to interact with a P4 repo?

I mainly do the former and use the @all switch. You can greatly reduce
the time if your `git-p4` machine is close to the P4 server and if you
reduce the P4 client spec used for the migration.

- Lars

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

* Re: git-p4: cloning with a change number does not import all files
  2017-11-27 12:52 ` Lars Schneider
@ 2017-11-29  3:48   ` Patrick Rouleau
  2017-12-01 12:45     ` Lars Schneider
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Rouleau @ 2017-11-29  3:48 UTC (permalink / raw)
  To: Lars Schneider; +Cc: git

Hi,

On Mon, Nov 27, 2017 at 7:52 AM, Lars Schneider
<larsxschneider@gmail.com> wrote:
>
> what is your goal here? Do you want to convert the repo to Git or do you
> want to use Git to interact with a P4 repo?

I want to use git to interact with a P4 repo. I am used to git tools
and I prefer them to
P4V. Visual Studio is also slower with P4 plugin and I hate P4
approach to check out
a file before modifying it. The .sln files always get check outed for no reason.

I am working remotely. The P4 server is behind a VPN. That one reason
I am trying to
clone from some point in the past. I also want to have some history to
see from where
come the code and from who.

Regards,
P. Rouleau

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

* Re: git-p4: cloning with a change number does not import all files
  2017-11-29  3:48   ` Patrick Rouleau
@ 2017-12-01 12:45     ` Lars Schneider
  2017-12-02 15:35       ` Patrick Rouleau
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Schneider @ 2017-12-01 12:45 UTC (permalink / raw)
  To: Patrick Rouleau; +Cc: git


> On 29 Nov 2017, at 04:48, Patrick Rouleau <prouleau72@gmail.com> wrote:
> 
> Hi,
> 
> On Mon, Nov 27, 2017 at 7:52 AM, Lars Schneider
> <larsxschneider@gmail.com> wrote:
>> 
>> what is your goal here? Do you want to convert the repo to Git or do you
>> want to use Git to interact with a P4 repo?
> 
> I want to use git to interact with a P4 repo. I am used to git tools
> and I prefer them to
> P4V. Visual Studio is also slower with P4 plugin and I hate P4
> approach to check out
> a file before modifying it. The .sln files always get check outed for no reason.
> 
> I am working remotely. The P4 server is behind a VPN. That one reason
> I am trying to
> clone from some point in the past. I also want to have some history to
> see from where
> come the code and from who.

Oh, I am with you. However, I only used git-p4 for a very short time in the 
way you want to use it. Therefore, I don't have much experience in that kind 
of usage pattern. I was able to convice my management to move all source to 
Git and I used git-p4 to migrate the repositories ;-)

Here is a talk on the topic if you want to learn more:
https://www.youtube.com/watch?v=QNixDNtwYJ0

Cheers,
Lars

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

* Re: git-p4: cloning with a change number does not import all files
  2017-12-01 12:45     ` Lars Schneider
@ 2017-12-02 15:35       ` Patrick Rouleau
  2017-12-02 17:55         ` Luke Diamand
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick Rouleau @ 2017-12-02 15:35 UTC (permalink / raw)
  To: Lars Schneider; +Cc: git

On Fri, Dec 1, 2017 at 7:45 AM, Lars Schneider <larsxschneider@gmail.com> wrote:
> Oh, I am with you. However, I only used git-p4 for a very short time in the
> way you want to use it. Therefore, I don't have much experience in that kind
> of usage pattern. I was able to convice my management to move all source to
> Git and I used git-p4 to migrate the repositories ;-)
>
> Here is a talk on the topic if you want to learn more:
> https://www.youtube.com/watch?v=QNixDNtwYJ0
>
> Cheers,
> Lars

Sadly, there is no way I convince the company to switch to git. They
have acquired
many companies in the past years and they have standardized around Perforce.
It is in part because they want access control and they need to store
a lot of binary
files (including big VM images).

I keep this video close to explain why I like git:
https://www.youtube.com/watch?v=o4PFDKIc2fs

Regards,
P. Rouleau

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

* Re: git-p4: cloning with a change number does not import all files
  2017-12-02 15:35       ` Patrick Rouleau
@ 2017-12-02 17:55         ` Luke Diamand
  2017-12-02 19:58           ` Patrick Rouleau
  0 siblings, 1 reply; 7+ messages in thread
From: Luke Diamand @ 2017-12-02 17:55 UTC (permalink / raw)
  To: Patrick Rouleau; +Cc: Lars Schneider, Git Users

On 2 December 2017 at 15:35, Patrick Rouleau <prouleau72@gmail.com> wrote:
> On Fri, Dec 1, 2017 at 7:45 AM, Lars Schneider <larsxschneider@gmail.com> wrote:
>> Oh, I am with you. However, I only used git-p4 for a very short time in the
>> way you want to use it. Therefore, I don't have much experience in that kind
>> of usage pattern. I was able to convice my management to move all source to
>> Git and I used git-p4 to migrate the repositories ;-)
>>
>> Here is a talk on the topic if you want to learn more:
>> https://www.youtube.com/watch?v=QNixDNtwYJ0
>>
>> Cheers,
>> Lars
>
> Sadly, there is no way I convince the company to switch to git. They
> have acquired
> many companies in the past years and they have standardized around Perforce.
> It is in part because they want access control and they need to store
> a lot of binary
> files (including big VM images).
>
> I keep this video close to explain why I like git:
> https://www.youtube.com/watch?v=o4PFDKIc2fs

I feel your pain.

I think I've sort of stumbled across something like the problem you've
described in the past. Perhaps the files you need have been deleted
and then re-integrated or some such.

Would you be able to take a look at some files with this problem and
see if you can spot what's happened to it ("p4 changes" and perhaps
"p4 changes -i").

One thing that can certainly happen is that Perforce gets *very*
confused if you start getting too clever with symlinked directories,
and git-p4 can only do so much in the face of this. But it may be
something else.

Thanks
Luke

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

* Re: git-p4: cloning with a change number does not import all files
  2017-12-02 17:55         ` Luke Diamand
@ 2017-12-02 19:58           ` Patrick Rouleau
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Rouleau @ 2017-12-02 19:58 UTC (permalink / raw)
  To: Luke Diamand; +Cc: Lars Schneider, Git Users

On Sat, Dec 2, 2017 at 12:55 PM, Luke Diamand <luke@diamand.org> wrote:
> I think I've sort of stumbled across something like the problem you've
> described in the past. Perhaps the files you need have been deleted
> and then re-integrated or some such.
>
> Would you be able to take a look at some files with this problem and
> see if you can spot what's happened to it ("p4 changes" and perhaps
> "p4 changes -i").

Sorry, but these commands only show the date and an extract of the commit
message.

>
> One thing that can certainly happen is that Perforce gets *very*
> confused if you start getting too clever with symlinked directories,
> and git-p4 can only do so much in the face of this. But it may be
> something else.

Overall, the depot history is very "messy". It contains a lot of projects. The
project on which I work has reach v5 and it has been branched from v4.
From p4v's "show graph", I can see there was a 'main' branch at some point,
but it doesn't exist anymore.

One of the files missing from my clone only has 2 revisions and it was created
in the v5 branch. It was created at 608436 and modified at 608816. I cloned
from 610443, mainly because we added a feature branch and I want to access
it from git too (610443 is one month before the branch creation).

I will play a little bit with p4 to see if I can locate where the problem comes
from and maybe hack git-p4 to make it more verbose.

Thanks,
P. Rouleau

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

end of thread, other threads:[~2017-12-02 20:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 20:35 git-p4: cloning with a change number does not import all files Patrick Rouleau
2017-11-27 12:52 ` Lars Schneider
2017-11-29  3:48   ` Patrick Rouleau
2017-12-01 12:45     ` Lars Schneider
2017-12-02 15:35       ` Patrick Rouleau
2017-12-02 17:55         ` Luke Diamand
2017-12-02 19:58           ` Patrick Rouleau

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