Fossil SCM

Add the 'dont-commit' setting as a safety against accidental commits, per request in [forum:7643435a90|forum post 291f9af918].

danield 2023-01-06 13:10 trunk
Commit 884436ce749154dbf36353ca1ec60182e788afd78b8b7c3292f97b8851f473f1
2 files changed +3 +14 -9
--- src/checkin.c
+++ src/checkin.c
@@ -2253,10 +2253,13 @@
22532253
noSign = find_option("nosign",0,0)!=0;
22542254
privateFlag = find_option("private",0,0)!=0;
22552255
forceDelta = find_option("delta",0,0)!=0;
22562256
forceBaseline = find_option("baseline",0,0)!=0;
22572257
db_must_be_within_tree();
2258
+ if( db_get_boolean("dont-commit",0) ){
2259
+ fossil_fatal("committing is prohibited: the 'dont-commit' option is set");
2260
+ }
22582261
if( forceDelta ){
22592262
if( forceBaseline ){
22602263
fossil_fatal("cannot use --delta and --baseline together");
22612264
}
22622265
if( db_get_boolean("forbid-delta-manifests",0) ){
22632266
--- src/checkin.c
+++ src/checkin.c
@@ -2253,10 +2253,13 @@
2253 noSign = find_option("nosign",0,0)!=0;
2254 privateFlag = find_option("private",0,0)!=0;
2255 forceDelta = find_option("delta",0,0)!=0;
2256 forceBaseline = find_option("baseline",0,0)!=0;
2257 db_must_be_within_tree();
 
 
 
2258 if( forceDelta ){
2259 if( forceBaseline ){
2260 fossil_fatal("cannot use --delta and --baseline together");
2261 }
2262 if( db_get_boolean("forbid-delta-manifests",0) ){
2263
--- src/checkin.c
+++ src/checkin.c
@@ -2253,10 +2253,13 @@
2253 noSign = find_option("nosign",0,0)!=0;
2254 privateFlag = find_option("private",0,0)!=0;
2255 forceDelta = find_option("delta",0,0)!=0;
2256 forceBaseline = find_option("baseline",0,0)!=0;
2257 db_must_be_within_tree();
2258 if( db_get_boolean("dont-commit",0) ){
2259 fossil_fatal("committing is prohibited: the 'dont-commit' option is set");
2260 }
2261 if( forceDelta ){
2262 if( forceBaseline ){
2263 fossil_fatal("cannot use --delta and --baseline together");
2264 }
2265 if( db_get_boolean("forbid-delta-manifests",0) ){
2266
+14 -9
--- src/db.c
+++ src/db.c
@@ -4242,10 +4242,15 @@
42424242
/*
42434243
** SETTING: diff-command width=40 sensitive
42444244
** The value is an external command to run when performing a diff.
42454245
** If undefined, the internal text diff will be used.
42464246
*/
4247
+/*
4248
+** SETTING: dont-commit boolean default=off
4249
+** If enabled, prevent committing to this repository, as an extra precaution
4250
+** against accidentally checking in to a repository intended to be read-only.
4251
+*/
42474252
/*
42484253
** SETTING: dont-push boolean default=off
42494254
** If enabled, prevent this repository from pushing from client to
42504255
** server. This can be used as an extra precaution to prevent
42514256
** accidental pushes to a public server from a private clone.
@@ -4295,10 +4300,19 @@
42954300
** which are allowed to be edited using the /fileedit page.
42964301
** An empty list prohibits editing via that page. Note that
42974302
** it cannot edit binary files, so the list should not
42984303
** contain any globs for, e.g., images or PDFs.
42994304
*/
4305
+/*
4306
+** SETTING: forbid-delta-manifests boolean default=off
4307
+** If enabled on a client, new delta manifests are prohibited on
4308
+** commits. If enabled on a server, whenever a client attempts
4309
+** to obtain a check-in lock during auto-sync, the server will
4310
+** send the "pragma avoid-delta-manifests" statement in its reply,
4311
+** which will cause the client to avoid generating a delta
4312
+** manifest.
4313
+*/
43004314
/*
43014315
** SETTING: gdiff-command width=40 default=gdiff sensitive
43024316
** The value is an external command to run when performing a graphical
43034317
** diff. If undefined, text diff will be used.
43044318
*/
@@ -4441,19 +4455,10 @@
44414455
/*
44424456
** SETTING: pgp-command width=40 sensitive
44434457
** Command used to clear-sign manifests at check-in.
44444458
** Default value is "gpg --clearsign -o"
44454459
*/
4446
-/*
4447
-** SETTING: forbid-delta-manifests boolean default=off
4448
-** If enabled on a client, new delta manifests are prohibited on
4449
-** commits. If enabled on a server, whenever a client attempts
4450
-** to obtain a check-in lock during auto-sync, the server will
4451
-** send the "pragma avoid-delta-manifests" statement in its reply,
4452
-** which will cause the client to avoid generating a delta
4453
-** manifest.
4454
-*/
44554460
/*
44564461
** SETTING: proxy width=32 default=off
44574462
** URL of the HTTP proxy. If "system", the "http_proxy" environment variable is
44584463
** consulted. If undefined or "off", a direct HTTP connection is used.
44594464
*/
44604465
--- src/db.c
+++ src/db.c
@@ -4242,10 +4242,15 @@
4242 /*
4243 ** SETTING: diff-command width=40 sensitive
4244 ** The value is an external command to run when performing a diff.
4245 ** If undefined, the internal text diff will be used.
4246 */
 
 
 
 
 
4247 /*
4248 ** SETTING: dont-push boolean default=off
4249 ** If enabled, prevent this repository from pushing from client to
4250 ** server. This can be used as an extra precaution to prevent
4251 ** accidental pushes to a public server from a private clone.
@@ -4295,10 +4300,19 @@
4295 ** which are allowed to be edited using the /fileedit page.
4296 ** An empty list prohibits editing via that page. Note that
4297 ** it cannot edit binary files, so the list should not
4298 ** contain any globs for, e.g., images or PDFs.
4299 */
 
 
 
 
 
 
 
 
 
4300 /*
4301 ** SETTING: gdiff-command width=40 default=gdiff sensitive
4302 ** The value is an external command to run when performing a graphical
4303 ** diff. If undefined, text diff will be used.
4304 */
@@ -4441,19 +4455,10 @@
4441 /*
4442 ** SETTING: pgp-command width=40 sensitive
4443 ** Command used to clear-sign manifests at check-in.
4444 ** Default value is "gpg --clearsign -o"
4445 */
4446 /*
4447 ** SETTING: forbid-delta-manifests boolean default=off
4448 ** If enabled on a client, new delta manifests are prohibited on
4449 ** commits. If enabled on a server, whenever a client attempts
4450 ** to obtain a check-in lock during auto-sync, the server will
4451 ** send the "pragma avoid-delta-manifests" statement in its reply,
4452 ** which will cause the client to avoid generating a delta
4453 ** manifest.
4454 */
4455 /*
4456 ** SETTING: proxy width=32 default=off
4457 ** URL of the HTTP proxy. If "system", the "http_proxy" environment variable is
4458 ** consulted. If undefined or "off", a direct HTTP connection is used.
4459 */
4460
--- src/db.c
+++ src/db.c
@@ -4242,10 +4242,15 @@
4242 /*
4243 ** SETTING: diff-command width=40 sensitive
4244 ** The value is an external command to run when performing a diff.
4245 ** If undefined, the internal text diff will be used.
4246 */
4247 /*
4248 ** SETTING: dont-commit boolean default=off
4249 ** If enabled, prevent committing to this repository, as an extra precaution
4250 ** against accidentally checking in to a repository intended to be read-only.
4251 */
4252 /*
4253 ** SETTING: dont-push boolean default=off
4254 ** If enabled, prevent this repository from pushing from client to
4255 ** server. This can be used as an extra precaution to prevent
4256 ** accidental pushes to a public server from a private clone.
@@ -4295,10 +4300,19 @@
4300 ** which are allowed to be edited using the /fileedit page.
4301 ** An empty list prohibits editing via that page. Note that
4302 ** it cannot edit binary files, so the list should not
4303 ** contain any globs for, e.g., images or PDFs.
4304 */
4305 /*
4306 ** SETTING: forbid-delta-manifests boolean default=off
4307 ** If enabled on a client, new delta manifests are prohibited on
4308 ** commits. If enabled on a server, whenever a client attempts
4309 ** to obtain a check-in lock during auto-sync, the server will
4310 ** send the "pragma avoid-delta-manifests" statement in its reply,
4311 ** which will cause the client to avoid generating a delta
4312 ** manifest.
4313 */
4314 /*
4315 ** SETTING: gdiff-command width=40 default=gdiff sensitive
4316 ** The value is an external command to run when performing a graphical
4317 ** diff. If undefined, text diff will be used.
4318 */
@@ -4441,19 +4455,10 @@
4455 /*
4456 ** SETTING: pgp-command width=40 sensitive
4457 ** Command used to clear-sign manifests at check-in.
4458 ** Default value is "gpg --clearsign -o"
4459 */
 
 
 
 
 
 
 
 
 
4460 /*
4461 ** SETTING: proxy width=32 default=off
4462 ** URL of the HTTP proxy. If "system", the "http_proxy" environment variable is
4463 ** consulted. If undefined or "off", a direct HTTP connection is used.
4464 */
4465

Keyboard Shortcuts

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