Re: git-p4 and git clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 23, 2010 at 4:37 PM, Thomas Kistler <tkistler@xxxxxxxxxx> wrote:
> That doesn't seem to work. With --import-local, I can't even submit back from the original repository.

Hi.

For me it works in this scenario:
If your perforce depot is A, you "git-p4 clone --import-local" that
into B, then git clone B into C. From C you should be able to do
git-p4 submit.

So, my normal recipe (if anyones interested) is to not use B for
anything other than importing from p4 and functioning as a clone
source. Like so:

$ git-p4 clone --import-local //depot/A@all B
$ mv B/.git B.git
$ rm -rf B
$ cd B.git
$ git config core.bare true
$ rm refs/heads/master
$ echo ref: refs/heads/p4/master > HEAD

(Then I have a script that does "git-p4 sync --import-local" every so
often in this repo)

... And then on my working computer, I do:

$ git clone user@remote:B.git C
$ cd C
$ [work, work, work, git commit]
$ git-p4 submit

...And every so often:
$ git-p4 sync

(Disclaimer: recipe from memory... might not be 100% correct :-/)

-Tor Arvid-

>    $ cd tmp1
>    $ git-p4 clone --import-local //foo/bar
>    $ cd bar
>    $ git checkout p4/master
>    $ git-p4 submit --verbose
>
> Reading pipe: git name-rev HEAD
> Reading pipe: git config git-p4.allowSubmit
> Reading pipe: git rev-parse --symbolic  --remotes
> Reading pipe: git cat-file commit HEAD~0
> Reading pipe: git cat-file commit HEAD~1
> fatal: Not a valid object name HEAD~1
>
>
> -----Original Message-----
> From: Benjamin Meyer [mailto:ben@xxxxxxxxxxxxx]
> Sent: Monday, March 22, 2010 5:15 PM
> To: Thomas Kistler
> Cc: 'git@xxxxxxxxxxxxxxx'
> Subject: Re: git-p4 and git clone
>
>
> On Mar 22, 2010, at 7:16 PM, Thomas Kistler wrote:
>
>> I'm probably missing something fairly fundamental but I'm running into problems with cloning a git-p4 repository:
>>
>> First, I'm setting up a git-p4 master repository:
>>
>>    $ cd tmp1
>>    $ git-p4 clone //foo/bar
>>
>> Then I'm cloning it through git:
>>
>>    $ cd tmp2
>>    $ git clone tmp1/bar
>>
>> Finally, I'm trying to submit back to p4:
>>
>>    $ git-p4 submit
>>
>> This now fails because the remotes/p4/master seems to get lost when doing the "git clone". Is this supposed to work?
>>
>> -Thomas
>
> There is a -import-local option you can use.  Then the p4/master branch is local and when you do the second clone you will get the p4/master branch.
>
> -Benjamin Meyer
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may contain
> confidential information.  Any unauthorized review, use, disclosure or distribution
> is prohibited.  If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]