On Tue, Apr 21, 2015 at 5:27 AM, Natacha Porté <nata...@instinctive.eu>
wrote:
>
> So to make it short, the fossil repository is a prefix of what the git
> mirror currently is, with the extra git nodes being generated by git.
>
> Is there any way to backport the git commits into the fossil repository
> and still have an automatic script to push to the git mirror?
>
> Ideally it would still work with the script above, but from my foggy
> memory of this list there is currently no round-trip support, and my
> `sed` call in there probably murks things even further.
>

The effects of the sed command can be reversed, so I don't see that as a
problem.

I have never tried "fossil export --git -R orig.fossil | fossil import
new.fossil" so I don't know if the commits in new.fossil will be identical
to the ones in orig.fossil. I do know that only commits are supported in
Git, so new.fossil will not have any tickets, events or "internal" wiki
pages.

Also, I have no idea if Git supports incremental export. If it does, there
might be a way to tell Git what commits Fossil has (see below about Fossil
incremental export).

If Git doesn't support incremental export, AND the commits safely
round-trip, then I THINK that Fossil will ignore commits it already has.
Or, import to a new repo, use SQL commands to make the new repo look like a
clone of the original, then sync it to the original.

Of course, test all of this using clones of your repos - and make backups -
before importing/sync'ing to the real repos.


> So a more realistic request would a procedure to backport the git
> commits into fossil, and a new update script to only export stuff beyond
> the synchronization point.
>
> Would the "export-marks" feature be what I need? I haven't really
> understood what it is and how it works.
>

Fossil's incremental export/import works like:

# initial export
fossil export --git --export marksfile -R repo.fossil >firstexport

# incremental export
fossil export --git --import marksfile --export newmarks -R repo.fossil
>secondexport
mv marksfile oldmarks
mv newmarks marksfile

# initial import
fossil import --git mirror.fossil <firstexport

# incremental import
fossil import --git --inc mirror.fossil <secondexport

Assuming Git support incremental exports and there is a way to supply Git
with a list from a file, you would:

fossil export --git --export marksfile -R orig.fossil >/dev/null
# insert sed, awk, Perl or other script to convert marksfile to whatever
Git understands
# invoke git-fast-export with whatever options needed to use the list of
already exported commits.
# insert any script needed to (un)modify commit info in Git export file
fossil clone orig.fossil clone.fossil
fossil import --git --inc clone.fossil <gitexport

Again, make backups and clones, test all this, then import/sync to the real
repos.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to