Re: [fossil-users] How to import a few commits from a git mirror?

2016-08-29 Thread Ron W
On Sat, Aug 27, 2016 at 12:46 PM, Natacha Porté 
wrote:

> Hello,
>
> Short version: I have a git repository built a mirror of a main
> repository, a few changes happened to the git repository, and I would
> like to find a way to bring these changes back to the fossil repository
> so that the git repository can again be a simple mirror.
>
> Now sometimes people send pull requests on github, and sometimes I find
> them good, so for various reasons (mostly attribution) I accept them.
> So I end up with a git repository that no longer a mirror of my fossil
> repository, and I am looking for a way to get back to that state.
>

Since this is not frequent, maybe you could just merge the changes in your
git working copy to your Fossil working copy, then "fossil commit
--user-override"
to commit the changes back to Fossil. You could also include the git commit
ID in the commit comment or as a tag on the commit.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] How to import a few commits from a git mirror?

2016-08-28 Thread Natacha Porté
Hello,

on Saturday 27 August 2016 at 19:49, Richard Hipp wrote:
> On 8/27/16, Natacha Porté  wrote:
> > Short version: I have a git repository built a mirror of a main
> > repository, a few changes happened to the git repository, and I would
> > like to find a way to bring these changes back to the fossil repository
> > so that the git repository can again be a simple mirror.
> 
> One of my long-term goals is to enhance Fossil so that it can
> push/pull from a git mirror, or so that a git mirror can push/pull
> from the main Fossil repository.  Unfortunately, that isn't going to
> help you now.  Or this week.

I would guess that in order to achieve that goal, you would need to
match remote git commit ids with local fossil commit ids. I think that
would require either keeping state about the matching, in that case the
rest of my e-mail is useless, or recomputing them, which means solving
the "roundtrip problem" (i.e. having all the original git commit
information stored in the corresponding fossil commit).

From my recent experimentations, it seems you could solve the "roundtrip
problem" (at least for the commits I encountered in my situation) by
somehow storing beside the fossil commit the original time zone, and two
users ("author" and "committer" according to git) instead of one.

I will do a few more tests and then post here the solution I developed
for my problem, which is based on injecting the timezone and
auther/committer in the stream exported by fossil, using a sed filter.

That seem like a reasonable person-sized first step toward the long
term goal (unless you want to with the matching table solution), and it
would help a lot for my situation. If anyone feels up for the task...

I would gladly contribute code in that direction if I find time, but I
don't feel competent enough to design how the information would be
stored (new cards? optional extensions to existing cards? tags?
something else?), so I will let someone else come up with that.


Hoping this is useful,
Natasha


signature.asc
Description: PGP signature
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] How to import a few commits from a git mirror?

2016-08-27 Thread Richard Hipp
On 8/27/16, Natacha Porté  wrote:
> Hello,
>
> Short version: I have a git repository built a mirror of a main
> repository, a few changes happened to the git repository, and I would
> like to find a way to bring these changes back to the fossil repository
> so that the git repository can again be a simple mirror.

One of my long-term goals is to enhance Fossil so that it can
push/pull from a git mirror, or so that a git mirror can push/pull
from the main Fossil repository.  Unfortunately, that isn't going to
help you now.  Or this week.

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] How to import a few commits from a git mirror?

2016-08-27 Thread Kain Abel
Dear Natacha,

2016-08-27 18:46 GMT+02:00 Natacha Porté:
> Short version: I have a git repository built a mirror of a main
> repository, a few changes happened to the git repository, and I would
> like to find a way to bring these changes back to the fossil repository
> so that the git repository can again be a simple mirror.
> 

Are patch files an option?

- search a common base in git and fossil
- checkout the fossil version
- dump the changes to an unified diff/patch file e.g. 'git diff
7c000ae..e9250ff >export.diff'
(or add .diff to URL in GitHub)
- use patch e.g. 'patch -p1 -i export.diff' in the src root dir
and commit your stuff in fossil to a new branch and merge or pick the changes.

The other version: use both, git and fossil, to track your changes in
a source tree.
Make a full git clone and checkout an older version, which differs
from a common code base in fossil and play around with 'fossil open
repo $version --keep' and checkin your stuff step by step or as bulk
to an new branch and merge it.

I hope it will works for you,
Kain
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] How to import a few commits from a git mirror?

2016-08-27 Thread Natacha Porté
Hello,

Short version: I have a git repository built a mirror of a main
repository, a few changes happened to the git repository, and I would
like to find a way to bring these changes back to the fossil repository
so that the git repository can again be a simple mirror.


The long version is that all my personal projects are stored in fossil
repositories, because I like many aspect of the SCM. I also keep mirrors
on github, to help improve visibility in the rare case someone might
want to use my code. The mirrors are simply made with
`fossil export --git | git fast-import`

Now sometimes people send pull requests on github, and sometimes I find
them good, so for various reasons (mostly attribution) I accept them.
So I end up with a git repository that no longer a mirror of my fossil
repository, and I am looking for a way to get back to that state.

Currently the fossil repository gets frozen, and out-of-date, switch to
the git repository. This is very unsatisfying, especially when the git
repository is still officially a mere mirror, and the fossil repository
the official reference.

Has someone already solved that problem, or am I in uncharted territory?


Ideally, I would like a way to tinker with the fossil repository so that
`fossil export --git | git fast-import` works on subsequent commits.
Less ideally, I'm open to also tinker with the git repository, but I
would really really hate to rewrite history (e.g. by changing commit
identifying hashes). If need be, I would be even open to something like
`fossil export --git | special-script.sh | git fast-import`.


Incidentally, that is somewhat akin to the "roundtrip problem" of
losslessly converting a (partial) git repository into a fossil
repository, so that the conversion back returns to the original git
repository.

From what I can tell, the roundtrip problem is unsolvable at least
because git stores time zones but not fossil, so there is no way to have
`fossil export --git` output a time-zoned commit, and therefore a git
commit with the correct sha-1 (unless we can find a pre-image attack on
sha-1).

I think a way to work around the roundtrip problem would be to use
marks, but I have never been able to figure out how to use them in a
normal setting without losing some ancestry links.

If someone can explain it to me, maybe my problem can be solved with a
specially crafted commit that correctly passes `fossil export --git |
git fast-import` but with handcrafted ancestry to the foreign commits.


The other lead I have is to craft fossil commits as equivalent as
possible to the foreign commits, and then make a `special-script.sh` to
fix the remaining in the exported stream. That would mean keeping the
script around for ever, and accumulating changes as I import new foreign
commits. I still don't really know whether it is even possible to reach
the correct sha-1 that way, and I don't like having a "scar" of the pull
request that will be around forever, but if that's the only solution, so
be it.


So what do you think my leads? Am I missing another, easier way of
solving the problem? Or am I missing another difficulty that makes it
outright unsolvable?


Thanks in advance for your help,
Natasha


signature.asc
Description: PGP signature
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users