git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug in git-p4?
@ 2009-05-04 19:20 Mercier, Carl
  2009-05-08 11:43 ` Tor Arvid Lund
  0 siblings, 1 reply; 4+ messages in thread
From: Mercier, Carl @ 2009-05-04 19:20 UTC (permalink / raw)
  To: git

Hello all,

I've been trying to use git-p4 without much success.  My setup is very simple:

- 1 existing Git repo (with data)
- 1 existing P4 depot (with an empty subdirectory)
- We commit and push to Git and our company requires all the code to be stored in P4 (in the p4 empty subdir).

Here's what I did:

cd /root/p4-repo/SecTech
git clone /home/git/repositories/web website
cd website
git-p4 sync //SecTech/website
git branch --track p4-master p4/master
git checkout p4-master
git merge master
git-p4 submit

CRASHES WITH:
Perforce checkout for depot path //SecTech/website/ located at /root/p4-repo/SecTech/website/
Syncronizing p4 checkout...
... - file(s) up-to-date.
Applying 32a1b2fe93f48c044d04ca37a276fe66afc988ce initial import

fatal: ambiguous argument '32a1b2fe93f48c044d04ca37a276fe66afc988ce^': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Command failed: git diff-tree -r  "32a1b2fe93f48c044d04ca37a276fe66afc988ce^" "32a1b2fe93f48c044d04ca37a276fe66afc988ce"



Am I doing something wrong or is there a bug in git-p4?

I'm a bit confused right now.  Thanks!

Carl


 Protected by Websense Hosted Email Security -- www.websense.com 

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

* Re: bug in git-p4?
  2009-05-04 19:20 bug in git-p4? Mercier, Carl
@ 2009-05-08 11:43 ` Tor Arvid Lund
  2009-05-08 18:02   ` Carl Mercier
  0 siblings, 1 reply; 4+ messages in thread
From: Tor Arvid Lund @ 2009-05-08 11:43 UTC (permalink / raw)
  To: Mercier, Carl; +Cc: git

On Mon, May 4, 2009 at 9:20 PM, Mercier, Carl <cmercier@websense.com> wrote:
> Hello all,
>
> I've been trying to use git-p4 without much success.  My setup is very simple:
>
> - 1 existing Git repo (with data)
> - 1 existing P4 depot (with an empty subdirectory)
> - We commit and push to Git and our company requires all the code to be stored in P4 (in the p4 empty subdir).
>
> Here's what I did:
>
> cd /root/p4-repo/SecTech
> git clone /home/git/repositories/web website
> cd website
> git-p4 sync //SecTech/website
> git branch --track p4-master p4/master
> git checkout p4-master
> git merge master
> git-p4 submit

Hi. What I try to do at my job, is to consider the P4 depot to be the
"master" depot, since I consider it the "weaker" of the two VCSs. I
have not had much success doing git merges and then trying to sync
with P4. I instead use rebasing a lot. So what I would do in your
situation is something like:

...
git-p4 sync //SecTech/website
git rebase p4/master
git-p4 submit

So.. my normal flow of work is:

code
commit
code
commit
git p4 sync
git rebase p4/master
git p4 commit

Don't know if this is something that might work for you, though...

-Tor Arvid-

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

* Re: bug in git-p4?
  2009-05-08 11:43 ` Tor Arvid Lund
@ 2009-05-08 18:02   ` Carl Mercier
  2009-05-08 21:46     ` Daniel Barkalow
  0 siblings, 1 reply; 4+ messages in thread
From: Carl Mercier @ 2009-05-08 18:02 UTC (permalink / raw)
  To: Tor Arvid Lund; +Cc: git

Thank you.

What I'm trying to accomplish is a little bit different. We've been  
using Git with a remote server for so long, we don't want to give that  
up. (and we also can't for some reasons).  So what I was hoping to do  
was simply keep working with out remote Git server as normal, and then  
have another server pull from Git and submit to P4.

We have many Git repos we'd like to store into P4 subdirectories.  For  
example:

website.git -> //SecTech/website
api.git -> //SecTech/api

I just can't seem to get this to work because git-p4 seems to expect a  
brand new Git repo to work properly.

What would be the correct way to accomplish this?

Carl Mercier
Director of software development
Defensio.com, a Websense service



On 8-May-09, at 7:43 AM, Tor Arvid Lund wrote:

> On Mon, May 4, 2009 at 9:20 PM, Mercier, Carl  
> <cmercier@************> wrote:
>> Hello all,
>>
>> I've been trying to use git-p4 without much success.  My setup is  
>> very simple:
>>
>> - 1 existing Git repo (with data)
>> - 1 existing P4 depot (with an empty subdirectory)
>> - We commit and push to Git and our company requires all the code  
>> to be stored in P4 (in the p4 empty subdir).
>>
>> Here's what I did:
>>
>> cd /root/p4-repo/SecTech
>> git clone /home/git/repositories/web website
>> cd website
>> git-p4 sync //SecTech/website
>> git branch --track p4-master p4/master
>> git checkout p4-master
>> git merge master
>> git-p4 submit
>
> Hi. What I try to do at my job, is to consider the P4 depot to be the
> "master" depot, since I consider it the "weaker" of the two VCSs. I
> have not had much success doing git merges and then trying to sync
> with P4. I instead use rebasing a lot. So what I would do in your
> situation is something like:
>
> ...
> git-p4 sync //SecTech/website
> git rebase p4/master
> git-p4 submit
>
> So.. my normal flow of work is:
>
> code
> commit
> code
> commit
> git p4 sync
> git rebase p4/master
> git p4 commit
>
> Don't know if this is something that might work for you, though...
>
> -Tor Arvid-



 Protected by Websense Hosted Email Security -- www.websense.com 

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

* Re: bug in git-p4?
  2009-05-08 18:02   ` Carl Mercier
@ 2009-05-08 21:46     ` Daniel Barkalow
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Barkalow @ 2009-05-08 21:46 UTC (permalink / raw)
  To: Carl Mercier; +Cc: Tor Arvid Lund, git

On Fri, 8 May 2009, Carl Mercier wrote:

> Thank you.
> 
> What I'm trying to accomplish is a little bit different. We've been using Git
> with a remote server for so long, we don't want to give that up. (and we also
> can't for some reasons).  So what I was hoping to do was simply keep working
> with out remote Git server as normal, and then have another server pull from
> Git and submit to P4.
> 
> We have many Git repos we'd like to store into P4 subdirectories.  For
> example:
> 
> website.git -> //SecTech/website
> api.git -> //SecTech/api
> 
> I just can't seem to get this to work because git-p4 seems to expect a brand
> new Git repo to work properly.

You're going to have a whole bunch of problems, most likely, including 
that Perforce doesn't suppose the history structure that git uses (where a 
revision can have multiple parents without these revisions having 
different codelines).

Most likely, what you actually want to do is essentially send Perforce 
git's reflog. You should be able to write a short post-update hook that 
takes the diff between the before and after, add/edit/delete the files 
that changed, change a client workspace, and submit it.

	-Daniel
*This .sig left intentionally blank*

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

end of thread, other threads:[~2009-05-08 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-04 19:20 bug in git-p4? Mercier, Carl
2009-05-08 11:43 ` Tor Arvid Lund
2009-05-08 18:02   ` Carl Mercier
2009-05-08 21:46     ` Daniel Barkalow

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