Fossil User Forum

When should I use fossil open and fossil close?
Login

When should I use fossil open and fossil close?

When should I use fossil open and fossil close?

(1) By Thomas M (tmunnlx) on 2023-06-07 22:24:01 [link] [source]

I am very new to fossil, and have figured out what seems to be checking in, out, and stuff like that. But my question is:

Should I after committing all my changes at the end of the day do a 'fossil close' from my directory where my source files are being tracked from? and then an "fossil open" in the same directory the next day? or do I just leave the fossil open command.

Where its more interesting, if two people are using the same database on a fileserver is it a good idea to close the repo when I am done with it?

Thomas

(2) By Richard Hipp (drh) on 2023-06-07 23:01:34 in reply to 1 [link] [source]

I designed and created Fossil and I don’t think I have ever once done a “fossil close” except when testing Fossil. So, no, you don’t need to do that.

Your post (and others like it) make me think I should have never created the “fossil close” command. :-)

Multiple people can use the same repo at the same time. But it seems better and easier and more fossil-like to make your own clone.

(3) By Doug (doug9forester) on 2023-06-08 01:58:59 in reply to 1 [link] [source]

The words same database on a fileserver shouted a warning to me. A fossil database is an Sqlite database. And I understand that accessing an Sqlite database on a network is asking for it to be corrupted.

Did I get that wrong?

(4) By sean (jungleboogie) on 2023-06-08 03:10:17 in reply to 1 [source]

When in doubt, do as Richard recommends.

However, I seem to recall discussion around fossil close when it was regarding writing the repo to a thumb drive.
I think the general idea was someone was committing files to a thumb drive and issued a fossil close before removing/ejecting the thumb drive.

If multiple people are using the same repo, it would be best to clone it locally.

Fossil has a built in server so the repo can be cloned very easily.

server command and various options to host your repo.

(5) By Andy Bradford (andybradford) on 2023-06-08 04:28:42 in reply to 4 [link] [source]

> If multiple people are using the same  repo, it would be best to clone
> it locally.
>
> Fossil has a built in server so the repo can be cloned very easily.

However, keep in  mind that if people  are "local" as in  using the same
system for  accessing the  Fossil repository,  there is  no need  to run
"fossil server"  for cloning purposes.  Fossil can just as  easily clone
from a  filesystem path as  long as  all people cloning  have read/write
access to it.

For  example,  assuming   that  you  have  a   shared  repository  named
/var/repositories/project.fossil  and   you  have   properly  configured
permission on  the same, then all  users with access could  do something
like:


$ fossil clone /var/repositories/project.fossil ~/repos/project.fossil
$ mkdir ~/src/project
$ cd ~/src/project
$ fossil open ~/repos/project.fossil

Then  when your  users  commit  something into  their  "clone", it  will
get  automatically synchronized  (default  behavior is  autosync on)  to
/var/repositories/project.fossil

If you really want more granular  control over what each individual user
can do, though, "fossil server" would be better.

Andy