Discussion:
fossil/git interaction
(too old to reply)
Russ Paielli
2012-01-08 20:42:17 UTC
Permalink
I am an aero engineer and I have been using fossil for my own work for
several months, but I use only a few basic commands, and I am not an
advanced user by any means, so please indulge me here.

I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?

--Russ P.
--
http://RussP.us
Gé Weijers
2012-01-09 01:30:14 UTC
Permalink
Post by Russ Paielli
I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?
It's not impossible, but some usage models for git won't work with fossil.
The main git repository for git itself for instance has a branch that does
not grow linearly but gets 'rewritten' (git push -f) once in a while. That
won't fly with fossil, which refuses to rewrite history, however ugly :-)

The branching models also differ, in fossil a branch name is an attribute
of a commit, in git it's a pointer into the graph of commits.

To make a two-way mapping between git and fossil you'd need a database that
keeps a one-to-one correspondence between git commits and fossil commits,
and intelligently deal with the mismatches between the two. This has been
done for Mercurial and Git with some success, but I don't know how
successful it is, and what the limitations are.

Gé
--
Gé
Russ Paielli
2012-01-09 20:05:10 UTC
Permalink
Thanks for that clarification. If there is any way to make fossil
interact with git, even with restrictions, I think it would be well
worth doing. If Mercurial has done it, perhaps it can serve as a
model. As I said, everything seems to be in git/github these days, and
being able to use fossil to interact with it would be a huge plus.

--Russ P.
Post by Gé Weijers
Post by Russ Paielli
I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?
It's not impossible, but some usage models for git won't work with fossil.
The main git repository for git itself for instance has a branch that does
not grow linearly but gets 'rewritten' (git push -f) once in a while. That
won't fly with fossil, which refuses to rewrite history, however ugly :-)
The branching models also differ, in fossil a branch name is an attribute
of a commit, in git it's a pointer into the graph of commits.
To make a two-way mapping between git and fossil you'd need a database that
keeps a one-to-one correspondence between git commits and fossil commits,
and intelligently deal with the mismatches between the two. This has been
done for Mercurial and Git with some success, but I don't know how
successful it is, and what the limitations are.

--

--
http://RussP.us
Wes Freeman
2012-01-09 20:26:22 UTC
Permalink
I agree. I feel a bit traitorous (to fossil), but I have been using
github lately myself, with mercurial(!) and git repos. We have a
corporate github here as of a few months ago, so I've actually had to
move some repos to github from fossil. I tried doing this through the
export functionality with fossil, but it didn't seem to import
properly (whether the problem is on the git or fossil side, I have no
idea). I ended up going through fossil from the initial checkout,
incrementally updating to more recent versions (sometimes merging
small commits into one), and committing the code into git, until I got
to present time--which was somewhat painful and took the better part
of a late night.

It would be an excellent offering to have something like
http://hg-git.github.com/ for fossil. It might even grow the user base
significantly, given github's popularity... Not that that is
necessarily "the goal" of fossil.

Just throwing that out there for consideration...

Wes
Post by Russ Paielli
Thanks for that clarification. If there is any way to make fossil
interact with git, even with restrictions, I think it would be well
worth doing. If Mercurial has done it, perhaps it can serve as a
model. As I said, everything seems to be in git/github these days, and
being able to use fossil to interact with it would be a huge plus.
--Russ P.
Andreas Kupries
2012-01-09 23:51:54 UTC
Permalink
Post by Wes Freeman
I agree. I feel a bit traitorous (to fossil), but I have been using
github lately myself, with mercurial(!) and git repos. We have a
corporate github here as of a few months ago, so I've actually had to
move some repos to github from fossil.
I tried doing this through the
export functionality with fossil, but it didn't seem to import
properly (whether the problem is on the git or fossil side, I have no
idea).
I ended up going through fossil from the initial checkout,
incrementally updating to more recent versions (sometimes merging
small commits into one), and committing the code into git, until I got
to present time--which was somewhat painful and took the better part
of a late night.
Even this way of doing it should be scriptable. 'fossil next' and such,
although I have no idea if we have (undocumented) commands to determine
branches so that we can follow them as well, and to determine when we are at a
leaf.
Post by Wes Freeman
It would be an excellent offering to have something like
http://hg-git.github.com/ for fossil. It might even grow the user base
significantly, given github's popularity... Not that that is
necessarily "the goal" of fossil.
Just throwing that out there for consideration...
Would you be willing to lead on such a project ?
It might not be necessary to do so now.

I was thinking that this might make a nice GSoC project or two, and if a
student is willing, we would need a mentor (better two). Something to think
about as well.

(*) A quick look at hg-git it seems to use something called Dulwich, a
pure-Python package to access git repositories. P
--
Andreas Kupries
Senior Tcl Developer
ActiveState, The Dynamic Language Experts

P: 778.786.1122
F: 778.786.1133
***@activestate.com
http://www.activestate.com
Get insights on Open Source and Dynamic Languages at www.activestate.com/blog
Joerg Sonnenberger
2012-01-09 20:16:52 UTC
Permalink
Post by Russ Paielli
I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?
You can easily provide a git mirror of a fossil repository. It can be
somewhat painful for large repositories due to bugs in git's fast-import
code, but it certainly works. The NetBSD src and pkgsrc repositories I
maintain on github are created that way. I can't comment on the
stability of the process in the other direction, but modulo the usual
fallout from git rebase pushes, it should work.

Joerg
Andreas Kupries
2012-01-09 23:52:02 UTC
Permalink
Post by Joerg Sonnenberger
Post by Russ Paielli
I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?
You can easily provide a git mirror of a fossil repository. It can be
somewhat painful for large repositories due to bugs in git's fast-import
code, but it certainly works. The NetBSD src and pkgsrc repositories I
maintain on github are created that way.
Are you willing to share with us whatever scripts you are using for that ?
Post by Joerg Sonnenberger
I can't comment on the
stability of the process in the other direction, but modulo the usual
fallout from git rebase pushes, it should work.
--
Andreas Kupries
Senior Tcl Developer
ActiveState, The Dynamic Language Experts

P: 778.786.1122
F: 778.786.1133
***@activestate.com
http://www.activestate.com
Get insights on Open Source and Dynamic Languages at www.activestate.com/blog
Joerg Sonnenberger
2012-01-10 01:05:05 UTC
Permalink
Post by Andreas Kupries
Post by Joerg Sonnenberger
Post by Russ Paielli
I am wondering about fossil/git interaction. Everyone else seems to be
using git and github. I see that fossil can import from, and export to,
git. If I understand it correctly, however, that is only for creating a new
fossil or git repository. Shouldn't it be possible to pull from, or push
to, a git repository using fossil? If that were the case, one could use
fossil seemlessly with git. Wouldn't that be the ideal situation? Or am I
missing something?
You can easily provide a git mirror of a fossil repository. It can be
somewhat painful for large repositories due to bugs in git's fast-import
code, but it certainly works. The NetBSD src and pkgsrc repositories I
maintain on github are created that way.
Are you willing to share with us whatever scripts you are using for that ?
For the git export? It's just "fossil export | git fast-import --force"
followed by "git push || git push -f".

Joerg
Andreas Kupries
2012-01-10 16:06:10 UTC
Permalink
Post by Joerg Sonnenberger
Post by Andreas Kupries
Post by Joerg Sonnenberger
You can easily provide a git mirror of a fossil repository. It can be
somewhat painful for large repositories due to bugs in git's fast-import
code, but it certainly works. The NetBSD src and pkgsrc repositories I
maintain on github are created that way.
Are you willing to share with us whatever scripts you are using for that ?
For the git export? It's just "fossil export | git fast-import --force"
followed by "git push || git push -f".
Oh, ok. Sounds simple enough. Modulo working directories.
--
Andreas Kupries
Senior Tcl Developer
ActiveState, The Dynamic Language Experts

P: 778.786.1122
F: 778.786.1133
***@activestate.com
http://www.activestate.com
Get insights on Open Source and Dynamic Languages at www.activestate.com/blog
Continue reading on narkive:
Loading...