Fossil Forum

luziferius 1 month, 1 week ago

Post: Accepting PRs from a GitHub mirror possible? If so, how?

Hello forum,

I had set up a read-only GitHub mirror of a fossil repository by following .

Now, I've got a PR opened against the mirror. How would I go ahead, if I wanted to accept that?

I see two choices

1. Patch route

Take the commit as a patch and apply that. Relatively easy.

But what would the name format for the --user-override be so that git/GitHub accepts this as the commit author and links it back to the original author?

The last time I tried this route it led to a total brick in the exporter and I had to shun everything in order avoid crashes in the exporter. username <[email protected]> is definitely the wrong format and permanently bricks the exporter once used.

2. Some two-way-sync mechanism

Does some two-way sync magic work? There's the "Bidirectional Synchronization" section on the Import And Export wiki page. Is that usable to sync back a git mirror created by following the mirror guide, after accepting a PR on GitHub? I don't have any of the marks files mentioned, as the git mirror code doesn't generate them. Is it safe to generate on a currently synced mirror?

Any insights are appreciated.

Greetings, Thomas

jerryko 1 month, 1 week ago

... read-only GitHub mirror ...

By accepting their PR, you're turning read-only into read-write. Ideally, they should re-submit via your fossil project if being git read-only is your policy.

username mail@example.com is definitely the wrong format and permanently bricks the exporter once used.

I haven't used fossil git export ... so i don't know about the brick problem you've seen. I have accepted a git PR and the default username format that the fossil import method used was to just use the email portion as the fossil username. ie, in my fossil repo i'd see the commit user as [email protected].

Does some two-way sync magic work? ...

Yes i've synced in both directions, and accepted a PR via git, using fossil's import and (deprecated) export commands as described in the wiki page you've linked. I believe this is still the only method for this, although i'm happy to be wrong.

I don't have any of the marks files mentioned, as the git mirror code doesn't generate them.

It looks like git-marks is generated and kept in the .mirror_state directory as marks.txt.

But you would need to get a fossil-marks file somehow...

You could try doing a fresh fossil export ... to a new git repository and then compare branch head hash values between this git and your existing fossil git mirror. If the branch tip hashes match, then you can use those marks files cleanly.

If the hashes don't match, then depending on how disruptive you want to be, you could just force push the fossil export version to github anyway.

Or, if you have time to spare and know a bit of c/sql, you could try converting mirror.mmark to the fossil marks file format. But this is just a guess from me. I'm assuming that all the required info is captured in the mmarks table.

danshearer 1 month, 1 week ago

There is some analysis and working test code for driving the issue systems of GitHub and GitLab over at Software Heritage's GitHub archive.

Perhaps this may give you some ideas.

--
Dan Shearer
[email protected] / https://shearer.org/

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button