Fossil SCM
Add the 'dont-commit' setting as a safety against accidental commits, per request in [forum:7643435a90|forum post 291f9af918].
Commit
884436ce749154dbf36353ca1ec60182e788afd78b8b7c3292f97b8851f473f1
Parent
ead01b6f27f9b41…
2 files changed
+3
+14
-9
+3
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2253,10 +2253,13 @@ | ||
| 2253 | 2253 | noSign = find_option("nosign",0,0)!=0; |
| 2254 | 2254 | privateFlag = find_option("private",0,0)!=0; |
| 2255 | 2255 | forceDelta = find_option("delta",0,0)!=0; |
| 2256 | 2256 | forceBaseline = find_option("baseline",0,0)!=0; |
| 2257 | 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 | + } | |
| 2258 | 2261 | if( forceDelta ){ |
| 2259 | 2262 | if( forceBaseline ){ |
| 2260 | 2263 | fossil_fatal("cannot use --delta and --baseline together"); |
| 2261 | 2264 | } |
| 2262 | 2265 | if( db_get_boolean("forbid-delta-manifests",0) ){ |
| 2263 | 2266 |
| --- 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 |
M
src/db.c
+14
-9
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -4242,10 +4242,15 @@ | ||
| 4242 | 4242 | /* |
| 4243 | 4243 | ** SETTING: diff-command width=40 sensitive |
| 4244 | 4244 | ** The value is an external command to run when performing a diff. |
| 4245 | 4245 | ** If undefined, the internal text diff will be used. |
| 4246 | 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 | +*/ | |
| 4247 | 4252 | /* |
| 4248 | 4253 | ** SETTING: dont-push boolean default=off |
| 4249 | 4254 | ** If enabled, prevent this repository from pushing from client to |
| 4250 | 4255 | ** server. This can be used as an extra precaution to prevent |
| 4251 | 4256 | ** accidental pushes to a public server from a private clone. |
| @@ -4295,10 +4300,19 @@ | ||
| 4295 | 4300 | ** which are allowed to be edited using the /fileedit page. |
| 4296 | 4301 | ** An empty list prohibits editing via that page. Note that |
| 4297 | 4302 | ** it cannot edit binary files, so the list should not |
| 4298 | 4303 | ** contain any globs for, e.g., images or PDFs. |
| 4299 | 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 | +*/ | |
| 4300 | 4314 | /* |
| 4301 | 4315 | ** SETTING: gdiff-command width=40 default=gdiff sensitive |
| 4302 | 4316 | ** The value is an external command to run when performing a graphical |
| 4303 | 4317 | ** diff. If undefined, text diff will be used. |
| 4304 | 4318 | */ |
| @@ -4441,19 +4455,10 @@ | ||
| 4441 | 4455 | /* |
| 4442 | 4456 | ** SETTING: pgp-command width=40 sensitive |
| 4443 | 4457 | ** Command used to clear-sign manifests at check-in. |
| 4444 | 4458 | ** Default value is "gpg --clearsign -o" |
| 4445 | 4459 | */ |
| 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 | 4460 | /* |
| 4456 | 4461 | ** SETTING: proxy width=32 default=off |
| 4457 | 4462 | ** URL of the HTTP proxy. If "system", the "http_proxy" environment variable is |
| 4458 | 4463 | ** consulted. If undefined or "off", a direct HTTP connection is used. |
| 4459 | 4464 | */ |
| 4460 | 4465 |
| --- 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 |