Fossil Forum

Temporarily disable autosync
Login

Temporarily disable autosync

Temporarily disable autosync

(1) By spindrift on 2024-07-19 06:18:44 [source]

I am quite possibly being a bit thick.

Is it possible to disable autosync on a commit by commit basis?

Problem: I have a local clone which syncs with a cloud fossil server. This fossil server is not available all the time, and when it is not available, unfortunately its web address also serves a different tls certificate.

When I perform a local check-in, the autosync leads to a long sequence of me being asked if I accept the new certificate (N) then if I would like to continue (Y) then possibly other prompts, each time I try to commit.

Can I simulate an "offline" mode?

Can I somehow do something like --no-sync (I did check to see if there were options!).

I don't want to permanently detach from the "server" and value the autosync when it is available.

I always know in advance if the remote fossil server will be available.

My current workflow is by using

fossil ci -m "foo bar"

Advice welcome.

(2) By Warren Young (wyoung) on 2024-07-19 06:51:37 in reply to 1 [link] [source]

I’d just fossil set autosync off in this condition.

Plan B: sync to a more reliable local server and cron a sync from there to the dodgy remote. This gets you off-machine backup while the robot pounds mindlessly thru the damage until it achieves off-site backup.

(3) By spindrift on 2024-07-19 07:48:53 in reply to 2 [link] [source]

Thank you, both good options.

(4) By Richard Hipp (drh) on 2024-07-19 13:11:40 in reply to 1 [link] [source]

Check-in e8a21ab43c775a67 adds the --nosync option to the "fossil commit" command.

Aside:

There is inconsistency in the options. Some options that start with "--no" have a dash separating the "--no" with the word that follows and some do not.

Options without - after "--no":

  • backoffice --nodelay
  • backoffice --nolease
  • branch new --nosign
  • branch new --nosync
  • http --nocompress
  • http --nodelay
  • http --nojail
  • http --nossl
  • rebuild --noverify
  • rebuild --noindex
  • ui --nobrowser
  • ui --nocompress
  • ui --nojail
  • ui --nossl

Options with - after "--no"

  • changes --no-merge
  • changes --no-classify
  • commit --no-warnings
  • commit --no-prompt
  • commit --no-verify
  • clone --no-compress
  • clone --no-open
  • grep --no-messages
  • import --no-rev-tags
  • import --no-rebuild
  • import --no-vacuum
  • pull --no-http-compression
  • push --no-http-compression
  • sql --no-repository
  • sync --no-http-compression

(5) By Florian Balmer (florian.balmer) on 2024-07-19 16:40:05 in reply to 4 [link] [source]

I've already complained in advance when there was a discussion about --dry-run vs. --dryrun, but this time I'm more concerned: quite a few of these options appear in my scripts (a full terminal screen's worth of output) and also in my private patches. So I'd appreciate if both versions could be kept for compatibility?

(7) By Richard Hipp (drh) on 2024-07-19 17:28:06 in reply to 5 [link] [source]

I was not suggesting that we change anything. I was just observing the unfortunate inconsistency.....

(8.1) By Warren Young (wyoung) on 2024-07-19 18:00:24 edited from 8.0 in reply to 7 [link] [source]

I'd be advocating for a fix if it wasn't so nearly fifty-fifty. If one was a clear winner, we could shift over, but as it is?

The best idea I have is to abstract "no" handling as a tristate return from the option checker, where defining an option like "--nossl" implies that "--no-ssl" and the no-op "--ssl" options also exist. (The states would be true, false, and unset.)

I expect this would have to be done on a per-instance basis, since not all current Boolean options would make sense in a tristate form.

(9) By graham on 2024-07-19 18:16:02 in reply to 8.1 [link] [source]

Making sure there's a way of defining an option like --note that does not accept --no-te and --te.

(11) By Daniel Dumitriu (danield) on 2024-07-19 20:59:18 in reply to 9 [link] [source]

I like consistency. I'd advocate for the dash version, maybe biased by gcc - of course, keeping the no-dash (sic!) variant for compatibility where it currently exists.

(12) By spindrift on 2024-07-20 09:10:27 in reply to 7 [link] [source]

If the

--no-worries-bro

version was canonical, presumably it's not an issue to accept the

--noworries-bro
--noworriesbro

versions as long as they are unambiguous.

And presumably such ambiguity is easy to spot by comparing collapsed versions of the options.

I'm aware fossil already detects ambiguous short commands, and accepts minimal truncated commands if not ambiguous.

(13) By Stephan Beal (stephan) on 2024-07-20 11:25:31 in reply to 12 [link] [source]

I'm aware fossil already detects ambiguous short commands, and accepts minimal truncated commands if not ambiguous.

It can do that for top-level commands because those get compiled in to a shared top-level data structure as part of the build process. Subcommands and command-specific flags are handled in a more more "Wild West" style which would require an exceptional amount of surgery to rewrite for the 110-ish available commands (not counting the 149-ish test-* commands, most of which accept arguments as well).

We could maybe get away with teaching the CLI option handler to special-case anything starting with "no", to accept "no-" as well, and vice versa, but that sounds like a slippery slope. Patches would be thoughtfully considered.

(14) By spindrift on 2024-07-20 13:36:00 in reply to 13 [link] [source]

Ah. Frankly then I don't think I'd bother in that case.

The risk of some missed, unpredicted option like --note or --none=xxx popping up and catching people in the far future isn't worth it.

(6) By jshoyer on 2024-07-19 16:47:22 in reply to 4 [link] [source]

Thank you for the new feature! Kudos!

I have thought more than once than a --nosync flag would be useful. I look forward to trying it out.

(10) By spindrift on 2024-07-19 20:27:31 in reply to 4 [link] [source]

Thank you, much obliged.