git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Hausmann <simon@lst.de>
To: Scott Lamb <slamb@slamb.org>
Cc: git@vger.kernel.org
Subject: Re: git-p4import.py robustness changes
Date: Tue, 5 Jun 2007 09:21:56 +0200	[thread overview]
Message-ID: <200706050922.01431.simon@lst.de> (raw)
In-Reply-To: <99C09A45-EACF-43C0-8EF6-85450B109BF6@slamb.org>

[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]

On Monday 04 June 2007 09:19:56 Scott Lamb wrote:
> On Jun 3, 2007, at 10:54 PM, Shawn O. Pearce wrote:
> > I think writing data to fast-import is much easier than running
> > the raw Git commands, especially when you are talking about an
> > import engine where you need to set all of the special environment
> > variables for git-commit-tree or git-tag to do its job properly.
> > Its a good tool that simply doesn't get enough use, partly because
> > nobody is using it...
>
> Yeah, I'm sold. I read git-p4 more thoroughly and tried it out...it's
> pretty nice. The P4Sync command has a simpler, more trustworthy flow
> than git-p4import.py.
>
> On the Perforce side, I particularly like the use of "p4 print" to
> grab the files instead of "p4 sync". It avoids playing weird games
> with the client - I think nothing good can come of git-p4import.py's
> "p4 sync -k" and symlinks to map multiple branches into the same
> directory, which is not the Perforce way. Makes me nervous that
> what's submitted to git won't be the same as what's in the Perforce
> depot.
>
> I would have thought launching a "p4 print" on each file would be
> horribly slow with the network latency of each request, but...well,
> apparently not.

I've found it to be fast enough for "standard software development". When 
importing big changes like integrations of an entire branch then it naturally 
slows down. The workaround me and my colleague have come up with is to 
combine git-p4 usage with the regular git protocol:

For imports of simple projects from perforce the direct use of git-p4 clone 
and sync/rebase is good enough.

For big projects we have set up a dedicated (recycled old) machine that 
continuously imports from the perforce server. That makes the initial clone 
very fast thanks to the use of the git protocol, it still allows imports from 
perforce afterwards and when the developer syncs the chances are very high 
that the dedicated machine already imported the necessary changes/objects 
from the perforce server and the faster git protocol instead of "p4 print" on 
a lot of files can be used.

In order to avoid that machine constantly polling the p4 server we've come up 
with a neat little trick by adding a change-commit trigger on the p4 server 
that consists of a little perl script that just sends a single udp packet 
with the latest change number as notification to the git machine, which upon 
reception imports then.

That is why git-p4 sync/rebase call "git fetch" by default (configurable 
through config key) if there is an origin remote present.

> Maybe I'll work up git-p4 patches for subcommand error handling, like
> my git-p4import.py ones. And fix some style - seriously, who puts
> semicolons at the end of Python commands? *grumble*

I'd be more than happy to apply style patches. I'm not a very experienced 
python programmer and I admit that I certainly lack the style there :)

Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-06-05  8:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 16:47 git-p4import.py robustness changes Scott Lamb
2007-05-31 23:53 ` Junio C Hamano
2007-06-02 20:41   ` Scott Lamb
2007-06-02 21:33     ` Junio C Hamano
2007-06-02 23:21       ` Scott Lamb
2007-06-02 23:52         ` Junio C Hamano
2007-06-03 13:11       ` Simon Hausmann
2007-06-03 20:12         ` Scott Lamb
2007-06-04  5:54           ` Shawn O. Pearce
2007-06-04  6:09             ` Dana How
2007-06-04  6:18               ` Shawn O. Pearce
2007-06-04  7:19             ` Scott Lamb
2007-06-05  7:21               ` Simon Hausmann [this message]
2007-06-04  8:41           ` Marius Storm-Olsen
2007-06-04  5:56         ` Shawn O. Pearce
2007-06-12 21:46           ` Simon Hausmann
2007-06-13 21:06             ` Scott Lamb
2007-06-13 22:34               ` Simon Hausmann
2007-06-14  5:35             ` Shawn O. Pearce
2007-06-14 21:44               ` Simon Hausmann
2007-06-15  3:13                 ` Shawn O. Pearce
2007-06-15  5:30                 ` Marius Storm-Olsen, mstormo_git
2007-06-03  3:58 ` [PATCH 1/4] git-p4import: fix subcommand error handling Scott Lamb
2007-06-03  3:58   ` [PATCH 2/4] git-p4import: use lists of subcommand arguments Scott Lamb
2007-06-03  3:58     ` [PATCH 3/4] git-p4import: resume on correct p4 changeset Scott Lamb
2007-06-03  3:58       ` [PATCH 4/4] git-p4import: partial history Scott Lamb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200706050922.01431.simon@lst.de \
    --to=simon@lst.de \
    --cc=git@vger.kernel.org \
    --cc=slamb@slamb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).