2

I'm developing a bi-directional synchronization between Plastic SCM and Git.

I've seen the hg-git Mercurial plugin by Scott Chacon and I've seen it uses a local git repos to perform all operations, instead of directly "calling" the "remote git server".

Well, considering Chacon did it this way, I guess there's no better way to do it but I wanted to ask if there's a way to receive info about commits (revisions) remotely (like, "give me your tree of commits and how they're related so I can check with mines") and also a good way to create a "push" without having a full local git repos. I'm looking into the NGit and lib2git libraries.

Thanks,

pablo

pablo
  • 6,392
  • 4
  • 42
  • 62
  • What would be the gain, besides exploding complexity? – sehe Mar 16 '11 at 15:36
  • Ok, well, not having a local copy together with the plastic repo, which could be annoying for some developers. – pablo Mar 17 '11 at 08:45
  • Ok then - if the PlasticSCM local copy is just as good, you could look into the env vars `GIT_DIR`, `GIT_WORK_TREE` and `GIT_INDEX_FILE` (2nd one being more interesting, of course). $0.02 – sehe Mar 17 '11 at 13:43

1 Answers1

0

You can easily send-pack --thin a selection of revisions. Of course when you are going to use porcelain to isolate trees and blobs for sending, you might just as well skip to a git lib (like NGit, you mentioned), because it will come down to the same, but you can steer clear of perl/bash tangle :)

(bias entirely my own)

sehe
  • 374,641
  • 47
  • 450
  • 633
  • You mean creating a "pack" programatically and sending it back? – pablo Mar 16 '11 at 15:51
  • Well, I'd have to RTFM myself, but IIRC you can send-pack baserevspec..endrevspec and send it to PlasticSCM. You should be able to throw together a similar 'minimal' pack at the other side. Seeing as you'll have to go from PlasticSCM changesets to to git commits anyhow, I'm guessing you should be able to come up with something like that. If you think this is making it all waaaaaaay too complex and brittle, I couldn't agree more, which is why I commented directly on your question. Did you spot that remark? – sehe Mar 16 '11 at 19:30