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

A darcs that can pull from git

From
JCJuliusz Chroboczek <juliusz.chroboczek@pps.jussieu.fr>
Date
Apr 24, 2005, 22:32 UTC
Message-ID
<7ipswjbybx.fsf@lanthane.pps.jussieu.fr>

I've just finished putting together a hack for darcs to allow it to pull from Git repositories. You'll find the patch (Darcs patch, not diff patch) on

  http://www.pps.jussieu.fr/~jch/software/files/darcs-git-20050424.darcs

You should get yourself a copy of darcs-unstable, then apply this patch:

  $ darcs get http://www.abridgegame.org/repos/darcs-unstable darcs-git
  $ cd darcs-git
  $ darcs apply darcs-git-20050424.darcs
  $ make darcs

If you get merge conflicts, try using a version of the darcs-unstable tree from 18.04.2005, which is what I started with.

A minor problem: there's something broken with the build procedure; you'll probably need to manually do a ``make Context.hs'' followed with ``make darcs'' when the build breaks.

After you build darcs-git, you should be able to do something like
  $ cd ..
  $ mkdir a
  $ cd a
  $ darcs initialize
  $ ../darcs-git/darcs pull /usr/local/src/git-pasky-0.4
  $ darcs changes

This version can *pull* from git, but it cannot push; in other words, the only way to export your data from Darcs back to git is to use diff and patch.

Please be aware that this is just a proof-of-concept prototype. David and the rest of the Central Committee haven't looked at this code yet; it is quite likely that future versions of Darcs will generate completely different patches from git repositories. It is also likely that THIS CODE WILL EAT YOUR DATA.

The major issue is that we generate no patch dependencies. If you try to cherry-pick from repositories generated with this version, you'd better know what you're doing.

David, could you please have a look at the patches
  Sun Apr 24 16:50:02 CEST 2005  Juliusz Chroboczek <jch@pps.jussieu.fr>
    * First cut at remodularising repo access.
  Sun Apr 24 16:01:32 CEST 2005  Juliusz Chroboczek <jch@pps.jussieu.fr>
    * Change Repository to DarcsRepo.
and tell me whether this sort of restructuring is okay with you.

(David, I'm not claiming that this scheme is better than the ``tagging like crazy'' scheme that you outlined; I'm only trying to prove that my scheme is workable.)

Right now, I'm taking a Git commit and manually generating a Darcs patch id from that, which is a bad idea. A better way would be to get Darcs to deal with arbitrarily shaped patch ids; a patch that originates with git would get the git patch id, while a patch that comes from Darcs would retain its patch id even when pushed to git. David, you had some objections to that; any chance we could discuss the issue?

This is slow. There are a few obvious improvements to make to the performance, but I'd rather first implement whatsnew, diff and apply, and fix the problem with patch dependencies. (Whatsnew is where git's performance is actually likely to be better than Darcs, but it will require some abstracting of ``Slurpy'' in order to make that effective.) Unfortunately, I don't expect to have hacking time before next week-end.

Enjoy,
                                        Juliusz Chroboczek
Next: David Roundy
Message 1 of 7 in “A darcs that can pull from git”
  1. Juliusz ChroboczekApr 24, 2005
  2. David RoundyApr 25, 2005
  3. Juliusz ChroboczekApr 25, 2005
  4. Linus TorvaldsApr 26, 2005
  5. David RoundyApr 26, 2005
  6. Petr BaudisApr 26, 2005
  7. David RoundyApr 26, 2005

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.