Any solution for a multi-repository Fossil?
(1) By anonymous on 2018-09-07 13:40:56 [source]
Currently, I use Darcshub and Bitbucket and SourceForge and GitHub interchangeably, with the latter only being used for projects which are referenced from larger projects, e.g. some package managers which can't speak any other language than Git. (I really don't like Git.)
As all of them are actually managed in "cathedral-style" (I'm the only developer with very, very few contributors), I have come to the point where it would make sense to move most of my repositories (minus those which require being hosted on Git) to my own server. While I'm evaluating my options, I found Fossil, Mercurial, SVN and BitKeeper to be viable options. I would love to try Fossil first, but it looks like Fossil can't manage multiple repositories at the same time, e.g. code.mydomain.org/repo1
, .../repo2
and so on, because I would still have to "load" them separately.
Is that correct? (It would be saddening.)
(2) By Joel Dueck (joeld) on 2018-09-07 14:26:16 in reply to 1 [link] [source]
It can do this, including a kind of “single sign-on”; see this page and search for the phrase “multiple repositories”.
(3) By Warren Young (wyoung) on 2018-09-07 14:33:56 in reply to 1 [link] [source]
it looks like Fossil can't manage multiple repositories at the same time
Would you mind saying which pages you're looking at which give that impression? I or someone else may be able to improve them to avoid this misapprehension.
There are in fact at least three different ways to achieve your desired end:
Use
fossil server
in directory mode. (See paragraph 3 on that linked page.)Run Fossil in CGI mode, with one CGI script per repository. The script is trivial, and is given at the linked page.
If you're integrating this with an existing web site but want Fossil to run continuously for lower startup latency, you can do as I do, and run Fossil in SCGI mode, with your web server configured to proxy content under certain top-level directories to Fossil instances bound to localhost on separate TCP ports. See my
fslsrv
script below, which quickly and easily launches multiple Fossil instances for this purpose.
#!/bin/bash BASEPORT=12345 BASEURL=https://example.com function start_one() { bn=$1 port=$(($BASEPORT + $2)) ln="$3" url="$4" if [ -z "$ln" ] ; then ln="$bn" ; fi if [ -z "$url" ] ; then url="$BASEURL/$bn" ; fi fossil server --localhost --port $port --scgi \ --errorlog ~/log/fossil/$bn-errors.log --baseurl $url \ ~/museum/$bn.fossil > ~/log/fossil/$bn-stdout.log & echo Fossil server running for $bn, PID $!, port $port. } pgrep fossil | while read OLDPID do echo "Killing old Fossil instance (PID $OLDPID) first..." kill $OLDPID done start_one repo0 0 start_one repo1 1 "A Project Named Fred" start_one repo2 2 "" https://repo2.example.com/
You will need to customize the base URL at the top of the script and the start_one
calls at the end. Notice that you can make it serve everything under subdirectories of a common domain or to put some on other domains. I do a mix of both for my repositories, which is why the feature exists.
You should also pick a different random number for BASEPORT
in the 1024-32767 range.
The script assumes you keep your Fossils in ~/museum
, because why would you not? :)
(4) By anonymous on 2018-09-07 14:38:21 in reply to 3 [link] [source]
I see that my reading was incomplete. I, indeed, totally missed the part "or a directory containing many repositories" in the explanation for the "REPOSITORY" parameter... thank you!
Is there a way to list all "loaded" repositories or will I have to write an index file for that? :-)
(5) By Warren Young (wyoung) on 2018-09-07 14:41:35 in reply to 4 [link] [source]
Is there a way to list all "loaded" repositories
When you run fossil server
in directory mode, it serves every *.fossil
file found in that directory. You don't get a choice of which ones to expose and which ones to hide. If you want to serve only some repositories that way and not others, put the others somewhere else.
(7) By anonymous on 2018-09-07 15:19:45 in reply to 5 [link] [source]
But there is no "directory listing" built into Fossil, it seems. Everyone still needs to know the URLs. Damn.
(8) By Warren Young (wyoung) on 2018-09-07 15:30:34 in reply to 7 [link] [source]
You want -—repolist
, given on that same page, and in the ”Anonymous” answer below.
(9) By anonymous on 2018-09-07 15:32:25 in reply to 8 [link] [source]
Oh.
Yes, I do...
(6) By anonymous on 2018-09-07 14:41:52 in reply to 1 [link] [source]
I've used fossil to serve multiple repositories for a good while. The fossil server not only supports multiple repositories, but also provides a way to essentially allow single sign-on between those repositories. Just for example, I have (a much older version of) fossil running via systemd on a linux server to serve roughly 60 different repos internally; the relevant snippet from the systemd service configuration looks a bit like this: ExecStart=/usr/bin/fossil server --repolist --port 8181 --localhost --baseurl=https://REDACTED/fossil /data/fossil In this case, I'm using nginx in front of fossil in order to deal with SSL, redirects, and other non-fossil pages.
(10) By skywalk on 2018-09-07 15:35:43 in reply to 6 [link] [source]
Yes, Fossil serves multiple repo's, but they are independent. I've been meaning to post a feature request for a Fossil(Sauron) that can rule them all. Yes, I can script multi-project checkins/checkouts, but a Project type Fossil would be more clean. I envision a Master repo that pulls from a list of repo's. This would be a way to break up enormous repo's and compete with git's pile of files. Fossil(Sauron) being a handful of files.
(11) By Joel Dueck (joeld) on 2018-09-07 15:46:46 in reply to 10 [link] [source]
You can have a single set of users/passwords authorized across multiple repos using login groups (/setup_login_group in the web UI).
And a single instance can serve up multiple repos with directory mode.
Other than that, what more do you want? (My own usage is pretty basic so I'm just genuinely curious)
(12) By Warren Young (wyetr) on 2018-09-07 16:10:49 in reply to 10 [link] [source]
a feature request for a Fossil(Sauron) that can rule them all
It sounds like you want the equivalent of Git Submodules.
There are apparently a bunch of problems with Git submodules, but I don't know enough about it to say whether we could do better with our 20/20 hindsight.
What we have today is fossil open --nested
, but that doesn't get you a bunch of features you'd likely want:
fossil up
should update subrepos as well.fossil ci
should check for changes in subrepos as well, probably in depth-first order.fossil open
should automatically clone and open subrepos as well. That is, we want a way for multiple Fossil repositories to be logically tied together, so that opening one opens all the subrepos in their proper place. The auto-clone part of this should be smart enough to seek out existing clones and use those if present; else, there should be a configured URL for it to go to to get a clone.
That'll do for a start. There's plenty of ways to elaborate it, but I think that'll cover most of the common use cases.
I brought this up on the old mailing list once, but haven't done so again because it's a corner case for us. We've got one large Fossil repo that requires that a smaller Fossil repo be opened --nested
underneath it in each checkout directory, all with the same content. That last requirement is the major reason why we can't just put this subrepo's content into the main repo: the files in the subrepo must have a separate history, not tied to that of the main repo.
(13) By skywalk on 2018-09-07 16:43:19 in reply to 12 [link] [source]
Ha, I was not aware of Submodules? git is confusing enough, I shudder to think of nesting git repo's! No, what I prefer is the tidy Fossil repo(SQLite db), managed as a collection or project. Each repo remains independent, but I have a Fossil Project that uses a specific version from each repo within its project. If I wind up editing code from a subordinate repo, Fossil(Sauron) would make the push for me. :) If a subordinate repo grows, I continue to use the version(hash) in my Main project. Like many here, you probably have libraries that are stable and have infrequent changes. I'd tuck them away in a separate repo as source. Not as a dll to ease cross platform development.
(14) By Warren Young (wyetr) on 2018-09-07 19:40:29 in reply to 13 [link] [source]
the tidy Fossil repo(SQLite db), managed as a collection or project
That still sounds like Fossil subrepos to me.
Let's take this up in a new thread.