git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-p4: check for existence of repo dir before trying to create [Was: Asking again... [Re: how to properly import perforce history?]]

From
Simon Hausmann <simon@lst.de>
Date
Jun 11, 2007, 21:32 UTC
Message-ID
<200706112332.46996.simon@lst.de>
In-Reply-To
<20070611205140.GN25093@menevado.ms.com>

On Monday 11 June 2007 22:51:40 Kevin Green wrote: [...]

Show 8 quoted lines
> Anyway, grabbed git-p4 and tried it three ways:
>
> 1) git-p4 clone //depot/path/repo@all
>
>   I don't like this because it creates a git repository under "repo"
> subdir. To make a long store short, we have a very strict namespace for
>   development...  The path ends in src and I'd like the .git repository to
> be under src.
Fair enough :)
Show 11 quoted lines
> So, I tried this one level up:
>
> 2) git-p4 clone //depot/path/repo@all src
>
> 	But that dies with a mkdir error because 'src' already exists.  I want to
> 	submit a patch, but wanted to check with you first to see if that's the
> 	desired behaviour (I don't think it should fail though) because maybe you
> 	want to stop someone from scribbling on an already present git repository?
>
> 	I would want to just go for a "if it doesn't exist yet, create it,
> 	otherwise, forge ahead" behaviour.  I attach the patch after my .sig...
Thanks for the patch. Applied and pushed out.
Show 10 quoted lines
> 3) Tried without clone:
>
> $ git init
> $ git-p4 sync //depot/path/repo@all
>
> 	This looks like it's pulling down all the revisions, but it doesn't
> 	actually put any code in there.  I'm left with the same situation as
> 	git-p4import.py.
>
> 	Actually, not even.  I don't even have the commit history...

Actually... the import worked just fine, but I admit that it is not obvious _where_ the import went. I've just pushed out a change that makes git-p4 sync in this case also print out the ref. By default git-p4 sync imports into refs/remotes/p4/master, so after the above command a simple

	git branch -r
should print
	p4/HEAD
	p4/master

so you could for example just create a new master branch based on your p4 import using

	git branch master p4
	git checkout master
I hope this helps :)
Simon
Previous: Kevin Green
Message 16 of 16 in “how to properly import perforce history...”
  1. Kevin GreenJun 8, 2007
  2. Asking again... [Re: how to properly import perforce history?]Kevin Green, Jun 11, 2007
  3. Simon HausmannJun 11, 2007
  4. Alex RiesenJun 11, 2007
  5. Simon HausmannJun 11, 2007
  6. Alex RiesenJun 11, 2007
  7. Scott LambJun 11, 2007
  8. Alex RiesenJun 11, 2007
  9. Scott LambJun 11, 2007
  10. Simon HausmannJun 11, 2007
  11. Han-Wen NienhuysJun 12, 2007
  12. Alex RiesenJun 12, 2007
  13. Kevin GreenJun 11, 2007
  14. Alex RiesenJun 11, 2007
  15. git-p4: check for existence of repo dir before trying to create [Was: Asking again... [Re: how to properly import perforce history?]]Kevin Green, Jun 11, 2007
  16. Simon HausmannJun 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.