Fossil SCM

Improvements to settings: (1) add the --changed option to the "fossil settings" command to cause display of only settings whose value differs from the default. (2) omit the idea of settings that are only shown if their value is not the default. (3) For settings with multiple lines of text, show them indented after the setting name on the "fossil settings" output. (4) The /setup_settings page only shows changed settings by default, with a submenu option to show all settings.

drh 2025-03-20 17:20 trunk
Commit 74a5e10b9b281f1724f3b96572b3234719d583d5543c2903792dffcffdffd54c
--- src/allrepo.c
+++ src/allrepo.c
@@ -316,10 +316,11 @@
316316
zCmd = "repack";
317317
}else if( fossil_strcmp(zCmd, "set")==0
318318
|| fossil_strcmp(zCmd, "setting")==0
319319
|| fossil_strcmp(zCmd, "settings")==0 ){
320320
zCmd = "settings -R";
321
+ collect_argument(&extra, "changed", 0);
321322
collect_argv(&extra, 3);
322323
}else if( fossil_strcmp(zCmd, "unset")==0 ){
323324
zCmd = "unset -R";
324325
collect_argv(&extra, 3);
325326
}else if( fossil_strcmp(zCmd, "fts-config")==0 ){
326327
--- src/allrepo.c
+++ src/allrepo.c
@@ -316,10 +316,11 @@
316 zCmd = "repack";
317 }else if( fossil_strcmp(zCmd, "set")==0
318 || fossil_strcmp(zCmd, "setting")==0
319 || fossil_strcmp(zCmd, "settings")==0 ){
320 zCmd = "settings -R";
 
321 collect_argv(&extra, 3);
322 }else if( fossil_strcmp(zCmd, "unset")==0 ){
323 zCmd = "unset -R";
324 collect_argv(&extra, 3);
325 }else if( fossil_strcmp(zCmd, "fts-config")==0 ){
326
--- src/allrepo.c
+++ src/allrepo.c
@@ -316,10 +316,11 @@
316 zCmd = "repack";
317 }else if( fossil_strcmp(zCmd, "set")==0
318 || fossil_strcmp(zCmd, "setting")==0
319 || fossil_strcmp(zCmd, "settings")==0 ){
320 zCmd = "settings -R";
321 collect_argument(&extra, "changed", 0);
322 collect_argv(&extra, 3);
323 }else if( fossil_strcmp(zCmd, "unset")==0 ){
324 zCmd = "unset -R";
325 collect_argv(&extra, 3);
326 }else if( fossil_strcmp(zCmd, "fts-config")==0 ){
327
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -2283,11 +2283,11 @@
22832283
char **pB = (char**)b;
22842284
return fossil_strcmp(pA[0], pB[0]);
22852285
}
22862286
22872287
/*
2288
-** SETTING: verify-comments width=8 default=on if-chng
2288
+** SETTING: verify-comments width=8 default=on
22892289
**
22902290
** This setting determines how much sanity checking, if any, the
22912291
** "fossil commit" and "fossil amend" commands do against check-in
22922292
** comments. Recognized values:
22932293
**
22942294
--- src/checkin.c
+++ src/checkin.c
@@ -2283,11 +2283,11 @@
2283 char **pB = (char**)b;
2284 return fossil_strcmp(pA[0], pB[0]);
2285 }
2286
2287 /*
2288 ** SETTING: verify-comments width=8 default=on if-chng
2289 **
2290 ** This setting determines how much sanity checking, if any, the
2291 ** "fossil commit" and "fossil amend" commands do against check-in
2292 ** comments. Recognized values:
2293 **
2294
--- src/checkin.c
+++ src/checkin.c
@@ -2283,11 +2283,11 @@
2283 char **pB = (char**)b;
2284 return fossil_strcmp(pA[0], pB[0]);
2285 }
2286
2287 /*
2288 ** SETTING: verify-comments width=8 default=on
2289 **
2290 ** This setting determines how much sanity checking, if any, the
2291 ** "fossil commit" and "fossil amend" commands do against check-in
2292 ** comments. Recognized values:
2293 **
2294
+50 -16
--- src/db.c
+++ src/db.c
@@ -4439,15 +4439,19 @@
44394439
}
44404440
44414441
/*
44424442
** Print the current value of a setting identified by the pSetting
44434443
** pointer.
4444
+**
4445
+** Only show the value, not the setting name, if valueOnly is true.
4446
+**
4447
+** Show nothing if bIfChng is true and the setting is not currently set
4448
+** or is set to its default value.
44444449
*/
4445
-void print_setting(const Setting *pSetting, int valueOnly, int bAlways){
4450
+void print_setting(const Setting *pSetting, int valueOnly, int bIfChng){
44464451
Stmt q;
44474452
int versioned = 0;
4448
- if( !pSetting->bIfChng ) bAlways = 1;
44494453
if( pSetting->versionable && g.localOpen ){
44504454
/* Check to see if this is overridden by a versionable settings file */
44514455
Blob versionedPathname;
44524456
blob_zero(&versionedPathname);
44534457
blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4457,11 +4461,11 @@
44574461
}
44584462
blob_reset(&versionedPathname);
44594463
}
44604464
if( valueOnly && versioned ){
44614465
const char *zVal = db_get_versioned(pSetting->name, NULL, NULL);
4462
- if( bAlways || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
4466
+ if( !bIfChng || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
44634467
fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
44644468
}else{
44654469
versioned = 0;
44664470
}
44674471
return;
@@ -4479,24 +4483,57 @@
44794483
pSetting->name
44804484
);
44814485
}
44824486
if( db_step(&q)==SQLITE_ROW ){
44834487
const char *zVal = db_column_text(&q,1);
4484
- if( !bAlways && (zVal==0 || fossil_strcmp(zVal, pSetting->def)==0) ){
4485
- /* Don't display because the value is equal to the default */
4488
+ int noShow = 0;
4489
+ if( bIfChng ){
4490
+ /* Don't display the value is equal to the default */
4491
+ if( zVal==0 ){
4492
+ noShow = 1;
4493
+ }else if( pSetting->def ){
4494
+ if( pSetting->width==0 ){
4495
+ if( is_false(zVal) && is_false(pSetting->def) ) noShow = 1;
4496
+ }else{
4497
+ if( fossil_strcmp(zVal, pSetting->def)==0 ) noShow = 1;
4498
+ }
4499
+ }
4500
+ }
4501
+ if( noShow ){
4502
+ fossil_print("%-24s (versioned)\n", pSetting->name);
4503
+ versioned = 0;
44864504
}else if( valueOnly ){
44874505
fossil_print("%s\n", db_column_text(&q, 1));
44884506
}else{
4489
- fossil_print("%-20s %-8s %s\n", pSetting->name, db_column_text(&q, 0),
4490
- db_column_text(&q, 1));
4507
+ const char *zVal = (const char*)db_column_text(&q,1);
4508
+ const char *zName = (const char*)db_column_text(&q,0);
4509
+ if( zVal==0 ) zVal = "NULL";
4510
+ if( strchr(zVal,'\n')==0 ){
4511
+ fossil_print("%-24s %-11s %s\n", pSetting->name, zName, zVal);
4512
+ }else{
4513
+ fossil_print("%-24s %-11s\n", pSetting->name, zName);
4514
+ while( zVal[0] ){
4515
+ char *zNL = strchr(zVal, '\n');
4516
+ if( zNL==0 ){
4517
+ fossil_print(" %s\n", zVal);
4518
+ break;
4519
+ }else{
4520
+ int n = (int)(zNL - zVal);
4521
+ while( n>0 && fossil_isspace(zVal[n-1]) ){ n--; }
4522
+ fossil_print(" %.*s\n", n, zVal);
4523
+ zVal = zNL+1;
4524
+ }
4525
+ }
4526
+ }
44914527
}
4492
- }else if( !bAlways ){
4528
+ }else if( bIfChng ){
44934529
/* Display nothing */
4530
+ versioned = 0;
44944531
}else if( valueOnly ){
44954532
fossil_print("\n");
44964533
}else{
4497
- fossil_print("%-20s\n", pSetting->name);
4534
+ fossil_print("%-24s\n", pSetting->name);
44984535
}
44994536
if( versioned ){
45004537
fossil_print(" (overridden by contents of file .fossil-settings/%s)\n",
45014538
pSetting->name);
45024539
}
@@ -4527,11 +4564,10 @@
45274564
** negative for values which should not appear
45284565
** on the /setup_settings page. */
45294566
char versionable; /* Is this setting versionable? */
45304567
char forceTextArea; /* Force using a text area for display? */
45314568
char sensitive; /* True if this a security-sensitive setting */
4532
- char bIfChng; /* Only display if value differs from default */
45334569
const char *def; /* Default value */
45344570
};
45354571
45364572
#endif /* INTERFACE */
45374573
@@ -5238,24 +5274,23 @@
52385274
** configuration database. If both a local and a global value exists for a
52395275
** setting, the local value takes precedence. This command normally operates
52405276
** on the local settings. Use the --global option to change global settings.
52415277
**
52425278
** Options:
5279
+** --changed Only show settings if the value differs from the default
52435280
** --exact Only consider exact name matches
5244
-** --extra When listing settings, show them all, even those that are
5245
-** normally only shown if there values are different from default
52465281
** --global Set or unset the given property globally instead of
52475282
** setting or unsetting it for the open repository only
52485283
** --value Only show the value of a given property (implies --exact)
52495284
**
52505285
** See also: [[configuration]]
52515286
*/
52525287
void setting_cmd(void){
52535288
int i;
52545289
int globalFlag = find_option("global","g",0)!=0;
5290
+ int bIfChng = find_option("changed",0,0)!=0;
52555291
int exactFlag = find_option("exact",0,0)!=0;
5256
- int extraFlag = find_option("extra",0,0)!=0;
52575292
int valueFlag = find_option("value",0,0)!=0;
52585293
/* Undocumented "--test-for-subsystem SUBSYS" option used to test
52595294
** the db_get_for_subsystem() interface: */
52605295
const char *zSubsys = find_option("test-for-subsystem",0,1);
52615296
int unsetFlag = g.argv[1][0]=='u';
@@ -5275,16 +5310,15 @@
52755310
}
52765311
if( valueFlag ){
52775312
if( g.argc!=3 ){
52785313
fossil_fatal("--value is only supported when qurying a given property");
52795314
}
5280
- exactFlag = 1;
52815315
}
52825316
52835317
if( g.argc==2 ){
52845318
for(i=0; i<nSetting; i++){
5285
- print_setting(&aSetting[i], 0, extraFlag);
5319
+ print_setting(&aSetting[i], 0, bIfChng);
52865320
}
52875321
}else if( g.argc==3 || g.argc==4 ){
52885322
const char *zName = g.argv[2];
52895323
int n = (int)strlen(zName);
52905324
const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5335,11 +5369,11 @@
53355369
fossil_print(" [%s]", zValue);
53365370
fossil_free(zValue);
53375371
}
53385372
fossil_print("\n");
53395373
}else{
5340
- print_setting(pSetting, valueFlag, extraFlag);
5374
+ print_setting(pSetting, valueFlag, bIfChng);
53415375
}
53425376
pSetting++;
53435377
}
53445378
}
53455379
}else{
53465380
--- src/db.c
+++ src/db.c
@@ -4439,15 +4439,19 @@
4439 }
4440
4441 /*
4442 ** Print the current value of a setting identified by the pSetting
4443 ** pointer.
 
 
 
 
 
4444 */
4445 void print_setting(const Setting *pSetting, int valueOnly, int bAlways){
4446 Stmt q;
4447 int versioned = 0;
4448 if( !pSetting->bIfChng ) bAlways = 1;
4449 if( pSetting->versionable && g.localOpen ){
4450 /* Check to see if this is overridden by a versionable settings file */
4451 Blob versionedPathname;
4452 blob_zero(&versionedPathname);
4453 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4457,11 +4461,11 @@
4457 }
4458 blob_reset(&versionedPathname);
4459 }
4460 if( valueOnly && versioned ){
4461 const char *zVal = db_get_versioned(pSetting->name, NULL, NULL);
4462 if( bAlways || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
4463 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4464 }else{
4465 versioned = 0;
4466 }
4467 return;
@@ -4479,24 +4483,57 @@
4479 pSetting->name
4480 );
4481 }
4482 if( db_step(&q)==SQLITE_ROW ){
4483 const char *zVal = db_column_text(&q,1);
4484 if( !bAlways && (zVal==0 || fossil_strcmp(zVal, pSetting->def)==0) ){
4485 /* Don't display because the value is equal to the default */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4486 }else if( valueOnly ){
4487 fossil_print("%s\n", db_column_text(&q, 1));
4488 }else{
4489 fossil_print("%-20s %-8s %s\n", pSetting->name, db_column_text(&q, 0),
4490 db_column_text(&q, 1));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4491 }
4492 }else if( !bAlways ){
4493 /* Display nothing */
 
4494 }else if( valueOnly ){
4495 fossil_print("\n");
4496 }else{
4497 fossil_print("%-20s\n", pSetting->name);
4498 }
4499 if( versioned ){
4500 fossil_print(" (overridden by contents of file .fossil-settings/%s)\n",
4501 pSetting->name);
4502 }
@@ -4527,11 +4564,10 @@
4527 ** negative for values which should not appear
4528 ** on the /setup_settings page. */
4529 char versionable; /* Is this setting versionable? */
4530 char forceTextArea; /* Force using a text area for display? */
4531 char sensitive; /* True if this a security-sensitive setting */
4532 char bIfChng; /* Only display if value differs from default */
4533 const char *def; /* Default value */
4534 };
4535
4536 #endif /* INTERFACE */
4537
@@ -5238,24 +5274,23 @@
5238 ** configuration database. If both a local and a global value exists for a
5239 ** setting, the local value takes precedence. This command normally operates
5240 ** on the local settings. Use the --global option to change global settings.
5241 **
5242 ** Options:
 
5243 ** --exact Only consider exact name matches
5244 ** --extra When listing settings, show them all, even those that are
5245 ** normally only shown if there values are different from default
5246 ** --global Set or unset the given property globally instead of
5247 ** setting or unsetting it for the open repository only
5248 ** --value Only show the value of a given property (implies --exact)
5249 **
5250 ** See also: [[configuration]]
5251 */
5252 void setting_cmd(void){
5253 int i;
5254 int globalFlag = find_option("global","g",0)!=0;
 
5255 int exactFlag = find_option("exact",0,0)!=0;
5256 int extraFlag = find_option("extra",0,0)!=0;
5257 int valueFlag = find_option("value",0,0)!=0;
5258 /* Undocumented "--test-for-subsystem SUBSYS" option used to test
5259 ** the db_get_for_subsystem() interface: */
5260 const char *zSubsys = find_option("test-for-subsystem",0,1);
5261 int unsetFlag = g.argv[1][0]=='u';
@@ -5275,16 +5310,15 @@
5275 }
5276 if( valueFlag ){
5277 if( g.argc!=3 ){
5278 fossil_fatal("--value is only supported when qurying a given property");
5279 }
5280 exactFlag = 1;
5281 }
5282
5283 if( g.argc==2 ){
5284 for(i=0; i<nSetting; i++){
5285 print_setting(&aSetting[i], 0, extraFlag);
5286 }
5287 }else if( g.argc==3 || g.argc==4 ){
5288 const char *zName = g.argv[2];
5289 int n = (int)strlen(zName);
5290 const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5335,11 +5369,11 @@
5335 fossil_print(" [%s]", zValue);
5336 fossil_free(zValue);
5337 }
5338 fossil_print("\n");
5339 }else{
5340 print_setting(pSetting, valueFlag, extraFlag);
5341 }
5342 pSetting++;
5343 }
5344 }
5345 }else{
5346
--- src/db.c
+++ src/db.c
@@ -4439,15 +4439,19 @@
4439 }
4440
4441 /*
4442 ** Print the current value of a setting identified by the pSetting
4443 ** pointer.
4444 **
4445 ** Only show the value, not the setting name, if valueOnly is true.
4446 **
4447 ** Show nothing if bIfChng is true and the setting is not currently set
4448 ** or is set to its default value.
4449 */
4450 void print_setting(const Setting *pSetting, int valueOnly, int bIfChng){
4451 Stmt q;
4452 int versioned = 0;
 
4453 if( pSetting->versionable && g.localOpen ){
4454 /* Check to see if this is overridden by a versionable settings file */
4455 Blob versionedPathname;
4456 blob_zero(&versionedPathname);
4457 blob_appendf(&versionedPathname, "%s.fossil-settings/%s",
@@ -4457,11 +4461,11 @@
4461 }
4462 blob_reset(&versionedPathname);
4463 }
4464 if( valueOnly && versioned ){
4465 const char *zVal = db_get_versioned(pSetting->name, NULL, NULL);
4466 if( !bIfChng || (zVal!=0 && fossil_strcmp(zVal, pSetting->def)!=0) ){
4467 fossil_print("%s\n", db_get_versioned(pSetting->name, NULL, NULL));
4468 }else{
4469 versioned = 0;
4470 }
4471 return;
@@ -4479,24 +4483,57 @@
4483 pSetting->name
4484 );
4485 }
4486 if( db_step(&q)==SQLITE_ROW ){
4487 const char *zVal = db_column_text(&q,1);
4488 int noShow = 0;
4489 if( bIfChng ){
4490 /* Don't display the value is equal to the default */
4491 if( zVal==0 ){
4492 noShow = 1;
4493 }else if( pSetting->def ){
4494 if( pSetting->width==0 ){
4495 if( is_false(zVal) && is_false(pSetting->def) ) noShow = 1;
4496 }else{
4497 if( fossil_strcmp(zVal, pSetting->def)==0 ) noShow = 1;
4498 }
4499 }
4500 }
4501 if( noShow ){
4502 fossil_print("%-24s (versioned)\n", pSetting->name);
4503 versioned = 0;
4504 }else if( valueOnly ){
4505 fossil_print("%s\n", db_column_text(&q, 1));
4506 }else{
4507 const char *zVal = (const char*)db_column_text(&q,1);
4508 const char *zName = (const char*)db_column_text(&q,0);
4509 if( zVal==0 ) zVal = "NULL";
4510 if( strchr(zVal,'\n')==0 ){
4511 fossil_print("%-24s %-11s %s\n", pSetting->name, zName, zVal);
4512 }else{
4513 fossil_print("%-24s %-11s\n", pSetting->name, zName);
4514 while( zVal[0] ){
4515 char *zNL = strchr(zVal, '\n');
4516 if( zNL==0 ){
4517 fossil_print(" %s\n", zVal);
4518 break;
4519 }else{
4520 int n = (int)(zNL - zVal);
4521 while( n>0 && fossil_isspace(zVal[n-1]) ){ n--; }
4522 fossil_print(" %.*s\n", n, zVal);
4523 zVal = zNL+1;
4524 }
4525 }
4526 }
4527 }
4528 }else if( bIfChng ){
4529 /* Display nothing */
4530 versioned = 0;
4531 }else if( valueOnly ){
4532 fossil_print("\n");
4533 }else{
4534 fossil_print("%-24s\n", pSetting->name);
4535 }
4536 if( versioned ){
4537 fossil_print(" (overridden by contents of file .fossil-settings/%s)\n",
4538 pSetting->name);
4539 }
@@ -4527,11 +4564,10 @@
4564 ** negative for values which should not appear
4565 ** on the /setup_settings page. */
4566 char versionable; /* Is this setting versionable? */
4567 char forceTextArea; /* Force using a text area for display? */
4568 char sensitive; /* True if this a security-sensitive setting */
 
4569 const char *def; /* Default value */
4570 };
4571
4572 #endif /* INTERFACE */
4573
@@ -5238,24 +5274,23 @@
5274 ** configuration database. If both a local and a global value exists for a
5275 ** setting, the local value takes precedence. This command normally operates
5276 ** on the local settings. Use the --global option to change global settings.
5277 **
5278 ** Options:
5279 ** --changed Only show settings if the value differs from the default
5280 ** --exact Only consider exact name matches
 
 
5281 ** --global Set or unset the given property globally instead of
5282 ** setting or unsetting it for the open repository only
5283 ** --value Only show the value of a given property (implies --exact)
5284 **
5285 ** See also: [[configuration]]
5286 */
5287 void setting_cmd(void){
5288 int i;
5289 int globalFlag = find_option("global","g",0)!=0;
5290 int bIfChng = find_option("changed",0,0)!=0;
5291 int exactFlag = find_option("exact",0,0)!=0;
 
5292 int valueFlag = find_option("value",0,0)!=0;
5293 /* Undocumented "--test-for-subsystem SUBSYS" option used to test
5294 ** the db_get_for_subsystem() interface: */
5295 const char *zSubsys = find_option("test-for-subsystem",0,1);
5296 int unsetFlag = g.argv[1][0]=='u';
@@ -5275,16 +5310,15 @@
5310 }
5311 if( valueFlag ){
5312 if( g.argc!=3 ){
5313 fossil_fatal("--value is only supported when qurying a given property");
5314 }
 
5315 }
5316
5317 if( g.argc==2 ){
5318 for(i=0; i<nSetting; i++){
5319 print_setting(&aSetting[i], 0, bIfChng);
5320 }
5321 }else if( g.argc==3 || g.argc==4 ){
5322 const char *zName = g.argv[2];
5323 int n = (int)strlen(zName);
5324 const Setting *pSetting = db_find_setting(zName, !exactFlag);
@@ -5335,11 +5369,11 @@
5369 fossil_print(" [%s]", zValue);
5370 fossil_free(zValue);
5371 }
5372 fossil_print("\n");
5373 }else{
5374 print_setting(pSetting, valueFlag, bIfChng);
5375 }
5376 pSetting++;
5377 }
5378 }
5379 }else{
5380
+3 -3
--- src/printf.c
+++ src/printf.c
@@ -241,27 +241,27 @@
241241
return n;
242242
}
243243
#endif
244244
245245
/*
246
-** SETTING: timeline-plaintext boolean default=off if-chng
246
+** SETTING: timeline-plaintext boolean default=off
247247
**
248248
** If enabled, no wiki-formatting is done for timeline comment messages.
249249
** Hyperlinks are activated, but they show up on screen using the
250250
** complete input text, not just the display text. No other formatting
251251
** is done.
252252
*/
253253
/*
254
-** SETTING: timeline-block-markup boolean default=off if-chng
254
+** SETTING: timeline-block-markup boolean default=off
255255
**
256256
** If enabled, block markup (paragraph brakes, tables, lists, headings, etc)
257257
** is enabled while rendering check-in comment message on the timeline.
258258
** This is disabled by default, because the timeline works best if the
259259
** check-in comments are short and do not take up too much vertical space.
260260
*/
261261
/*
262
-** SETTING: timeline-hard-newlines boolean default=off if-chng
262
+** SETTING: timeline-hard-newlines boolean default=off
263263
**
264264
** If enabled, the timeline honors newline characters in check-in comments.
265265
** In other words, newlines are coverted into <br> for HTML display.
266266
** The default behavior, when this setting is off, is that newlines are
267267
** treated like any other whitespace character.
268268
--- src/printf.c
+++ src/printf.c
@@ -241,27 +241,27 @@
241 return n;
242 }
243 #endif
244
245 /*
246 ** SETTING: timeline-plaintext boolean default=off if-chng
247 **
248 ** If enabled, no wiki-formatting is done for timeline comment messages.
249 ** Hyperlinks are activated, but they show up on screen using the
250 ** complete input text, not just the display text. No other formatting
251 ** is done.
252 */
253 /*
254 ** SETTING: timeline-block-markup boolean default=off if-chng
255 **
256 ** If enabled, block markup (paragraph brakes, tables, lists, headings, etc)
257 ** is enabled while rendering check-in comment message on the timeline.
258 ** This is disabled by default, because the timeline works best if the
259 ** check-in comments are short and do not take up too much vertical space.
260 */
261 /*
262 ** SETTING: timeline-hard-newlines boolean default=off if-chng
263 **
264 ** If enabled, the timeline honors newline characters in check-in comments.
265 ** In other words, newlines are coverted into <br> for HTML display.
266 ** The default behavior, when this setting is off, is that newlines are
267 ** treated like any other whitespace character.
268
--- src/printf.c
+++ src/printf.c
@@ -241,27 +241,27 @@
241 return n;
242 }
243 #endif
244
245 /*
246 ** SETTING: timeline-plaintext boolean default=off
247 **
248 ** If enabled, no wiki-formatting is done for timeline comment messages.
249 ** Hyperlinks are activated, but they show up on screen using the
250 ** complete input text, not just the display text. No other formatting
251 ** is done.
252 */
253 /*
254 ** SETTING: timeline-block-markup boolean default=off
255 **
256 ** If enabled, block markup (paragraph brakes, tables, lists, headings, etc)
257 ** is enabled while rendering check-in comment message on the timeline.
258 ** This is disabled by default, because the timeline works best if the
259 ** check-in comments are short and do not take up too much vertical space.
260 */
261 /*
262 ** SETTING: timeline-hard-newlines boolean default=off
263 **
264 ** If enabled, the timeline honors newline characters in check-in comments.
265 ** In other words, newlines are coverted into <br> for HTML display.
266 ** The default behavior, when this setting is off, is that newlines are
267 ** treated like any other whitespace character.
268
+12 -8
--- src/setup.c
+++ src/setup.c
@@ -1109,11 +1109,11 @@
11091109
*/
11101110
void setup_settings(void){
11111111
int nSetting;
11121112
int i;
11131113
Setting const *pSet;
1114
- int bExtra = P("extra")!=0;
1114
+ int bIfChng = P("all")==0;
11151115
const Setting *aSetting = setting_info(&nSetting);
11161116
11171117
login_check_credentials();
11181118
if( !g.perm.Setup ){
11191119
login_needed(0);
@@ -1126,30 +1126,34 @@
11261126
/* Provide read-only access to versioned settings,
11271127
but only if no repo file was explicitly provided. */
11281128
db_open_local(0);
11291129
}
11301130
db_begin_transaction();
1131
+ if( bIfChng ){
1132
+ @ <p>Only settings whose value is different from the default are shown.
1133
+ @ Click the "All" button above to set all settings.
1134
+ }
11311135
@ <p>Settings marked with (v) are "versionable" and will be overridden
11321136
@ by the contents of managed files named
11331137
@ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
11341138
@ If the file for a versionable setting exists, the value cannot be
11351139
@ changed on this screen.</p><hr><p>
11361140
@
11371141
@ <form action="%R/setup_settings" method="post"><div>
1138
- if( bExtra ){
1139
- @ <input type="hidden" name="extra" value="1">
1140
- style_submenu_element("No-Extras", "%R/setup_settings");
1142
+ if( bIfChng ){
1143
+ style_submenu_element("All", "%R/setup_settings?all");
11411144
}else{
1142
- style_submenu_element("Extras", "%R/setup_settings?extra");
1145
+ @ <input type="hidden" name="all" value="1">
1146
+ style_submenu_element("Changes-Only", "%R/setup_settings");
11431147
}
11441148
@ <table border="0"><tr><td valign="top">
11451149
login_insert_csrf_secret();
11461150
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11471151
if( pSet->width==0 ){
11481152
int hasVersionableValue = pSet->versionable &&
11491153
(db_get_versioned(pSet->name, NULL, NULL)!=0);
1150
- if( pSet->bIfChng && !bExtra ){
1154
+ if( bIfChng ){
11511155
const char *zVal = db_get(pSet->name, 0);
11521156
if( zVal==0 || is_false(zVal)==is_false(pSet->def) ) continue;
11531157
}
11541158
onoff_attribute("", pSet->name,
11551159
pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
@@ -1167,11 +1171,11 @@
11671171
@ <table>
11681172
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11691173
if( pSet->width>0 && !pSet->forceTextArea ){
11701174
int hasVersionableValue = pSet->versionable &&
11711175
(db_get_versioned(pSet->name, NULL, NULL)!=0);
1172
- if( pSet->bIfChng && !bExtra ){
1176
+ if( bIfChng ){
11731177
const char *zVal = db_get(pSet->name, 0);
11741178
if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
11751179
}
11761180
@ <tr><td>
11771181
@ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1190,11 +1194,11 @@
11901194
@</table>
11911195
@ </td><td style="width:50px;"></td><td valign="top">
11921196
for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
11931197
if( pSet->width>0 && pSet->forceTextArea ){
11941198
int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1195
- if( pSet->bIfChng && !bExtra ){
1199
+ if( bIfChng ){
11961200
const char *zVal = db_get(pSet->name, 0);
11971201
if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
11981202
}
11991203
@ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
12001204
if( pSet->versionable ){
12011205
--- src/setup.c
+++ src/setup.c
@@ -1109,11 +1109,11 @@
1109 */
1110 void setup_settings(void){
1111 int nSetting;
1112 int i;
1113 Setting const *pSet;
1114 int bExtra = P("extra")!=0;
1115 const Setting *aSetting = setting_info(&nSetting);
1116
1117 login_check_credentials();
1118 if( !g.perm.Setup ){
1119 login_needed(0);
@@ -1126,30 +1126,34 @@
1126 /* Provide read-only access to versioned settings,
1127 but only if no repo file was explicitly provided. */
1128 db_open_local(0);
1129 }
1130 db_begin_transaction();
 
 
 
 
1131 @ <p>Settings marked with (v) are "versionable" and will be overridden
1132 @ by the contents of managed files named
1133 @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
1134 @ If the file for a versionable setting exists, the value cannot be
1135 @ changed on this screen.</p><hr><p>
1136 @
1137 @ <form action="%R/setup_settings" method="post"><div>
1138 if( bExtra ){
1139 @ <input type="hidden" name="extra" value="1">
1140 style_submenu_element("No-Extras", "%R/setup_settings");
1141 }else{
1142 style_submenu_element("Extras", "%R/setup_settings?extra");
 
1143 }
1144 @ <table border="0"><tr><td valign="top">
1145 login_insert_csrf_secret();
1146 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1147 if( pSet->width==0 ){
1148 int hasVersionableValue = pSet->versionable &&
1149 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1150 if( pSet->bIfChng && !bExtra ){
1151 const char *zVal = db_get(pSet->name, 0);
1152 if( zVal==0 || is_false(zVal)==is_false(pSet->def) ) continue;
1153 }
1154 onoff_attribute("", pSet->name,
1155 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
@@ -1167,11 +1171,11 @@
1167 @ <table>
1168 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1169 if( pSet->width>0 && !pSet->forceTextArea ){
1170 int hasVersionableValue = pSet->versionable &&
1171 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1172 if( pSet->bIfChng && !bExtra ){
1173 const char *zVal = db_get(pSet->name, 0);
1174 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1175 }
1176 @ <tr><td>
1177 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1190,11 +1194,11 @@
1190 @</table>
1191 @ </td><td style="width:50px;"></td><td valign="top">
1192 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1193 if( pSet->width>0 && pSet->forceTextArea ){
1194 int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1195 if( pSet->bIfChng && !bExtra ){
1196 const char *zVal = db_get(pSet->name, 0);
1197 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1198 }
1199 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1200 if( pSet->versionable ){
1201
--- src/setup.c
+++ src/setup.c
@@ -1109,11 +1109,11 @@
1109 */
1110 void setup_settings(void){
1111 int nSetting;
1112 int i;
1113 Setting const *pSet;
1114 int bIfChng = P("all")==0;
1115 const Setting *aSetting = setting_info(&nSetting);
1116
1117 login_check_credentials();
1118 if( !g.perm.Setup ){
1119 login_needed(0);
@@ -1126,30 +1126,34 @@
1126 /* Provide read-only access to versioned settings,
1127 but only if no repo file was explicitly provided. */
1128 db_open_local(0);
1129 }
1130 db_begin_transaction();
1131 if( bIfChng ){
1132 @ <p>Only settings whose value is different from the default are shown.
1133 @ Click the "All" button above to set all settings.
1134 }
1135 @ <p>Settings marked with (v) are "versionable" and will be overridden
1136 @ by the contents of managed files named
1137 @ "<tt>.fossil-settings/</tt><i>SETTING-NAME</i>".
1138 @ If the file for a versionable setting exists, the value cannot be
1139 @ changed on this screen.</p><hr><p>
1140 @
1141 @ <form action="%R/setup_settings" method="post"><div>
1142 if( bIfChng ){
1143 style_submenu_element("All", "%R/setup_settings?all");
 
1144 }else{
1145 @ <input type="hidden" name="all" value="1">
1146 style_submenu_element("Changes-Only", "%R/setup_settings");
1147 }
1148 @ <table border="0"><tr><td valign="top">
1149 login_insert_csrf_secret();
1150 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1151 if( pSet->width==0 ){
1152 int hasVersionableValue = pSet->versionable &&
1153 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1154 if( bIfChng ){
1155 const char *zVal = db_get(pSet->name, 0);
1156 if( zVal==0 || is_false(zVal)==is_false(pSet->def) ) continue;
1157 }
1158 onoff_attribute("", pSet->name,
1159 pSet->var!=0 ? pSet->var : pSet->name /*works-like:"x"*/,
@@ -1167,11 +1171,11 @@
1171 @ <table>
1172 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1173 if( pSet->width>0 && !pSet->forceTextArea ){
1174 int hasVersionableValue = pSet->versionable &&
1175 (db_get_versioned(pSet->name, NULL, NULL)!=0);
1176 if( bIfChng ){
1177 const char *zVal = db_get(pSet->name, 0);
1178 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1179 }
1180 @ <tr><td>
1181 @ <a href='%R/help?cmd=%s(pSet->name)'>%h(pSet->name)</a>
@@ -1190,11 +1194,11 @@
1194 @</table>
1195 @ </td><td style="width:50px;"></td><td valign="top">
1196 for(i=0, pSet=aSetting; i<nSetting; i++, pSet++){
1197 if( pSet->width>0 && pSet->forceTextArea ){
1198 int hasVersionableValue = db_get_versioned(pSet->name, NULL, NULL)!=0;
1199 if( bIfChng ){
1200 const char *zVal = db_get(pSet->name, 0);
1201 if( zVal==0 || fossil_strcmp(zVal,pSet->def)==0 ) continue;
1202 }
1203 @ <a href='%R/help?cmd=%s(pSet->name)'>%s(pSet->name)</a>
1204 if( pSet->versionable ){
1205
+2 -2
--- src/timeline.c
+++ src/timeline.c
@@ -222,20 +222,20 @@
222222
}
223223
zPrevDate[0] = 0;
224224
mxWikiLen = db_get_int("timeline-max-comment", 0);
225225
dateFormat = db_get_int("timeline-date-format", 0);
226226
/*
227
- ** SETTING: timeline-truncate-at-blank boolean default=off if-chng
227
+ ** SETTING: timeline-truncate-at-blank boolean default=off
228228
**
229229
** If enabled, check-in comments displayed on the timeline are truncated
230230
** at the first blank line of the comment text. The comment text after
231231
** the first blank line is only seen in the /info or similar pages that
232232
** show details about the check-in.
233233
*/
234234
bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
235235
/*
236
- ** SETTING: timeline-tslink-info boolean default=off if-chng
236
+ ** SETTING: timeline-tslink-info boolean default=off
237237
**
238238
** The hyperlink on the timestamp associated with each timeline entry,
239239
** on the far left-hand side of the screen, normally targets another
240240
** /timeline page that shows the entry in context. However, if this
241241
** option is turned on, that hyperlink targets the /info page showing
242242
--- src/timeline.c
+++ src/timeline.c
@@ -222,20 +222,20 @@
222 }
223 zPrevDate[0] = 0;
224 mxWikiLen = db_get_int("timeline-max-comment", 0);
225 dateFormat = db_get_int("timeline-date-format", 0);
226 /*
227 ** SETTING: timeline-truncate-at-blank boolean default=off if-chng
228 **
229 ** If enabled, check-in comments displayed on the timeline are truncated
230 ** at the first blank line of the comment text. The comment text after
231 ** the first blank line is only seen in the /info or similar pages that
232 ** show details about the check-in.
233 */
234 bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
235 /*
236 ** SETTING: timeline-tslink-info boolean default=off if-chng
237 **
238 ** The hyperlink on the timestamp associated with each timeline entry,
239 ** on the far left-hand side of the screen, normally targets another
240 ** /timeline page that shows the entry in context. However, if this
241 ** option is turned on, that hyperlink targets the /info page showing
242
--- src/timeline.c
+++ src/timeline.c
@@ -222,20 +222,20 @@
222 }
223 zPrevDate[0] = 0;
224 mxWikiLen = db_get_int("timeline-max-comment", 0);
225 dateFormat = db_get_int("timeline-date-format", 0);
226 /*
227 ** SETTING: timeline-truncate-at-blank boolean default=off
228 **
229 ** If enabled, check-in comments displayed on the timeline are truncated
230 ** at the first blank line of the comment text. The comment text after
231 ** the first blank line is only seen in the /info or similar pages that
232 ** show details about the check-in.
233 */
234 bCommentGitStyle = db_get_int("timeline-truncate-at-blank", 0);
235 /*
236 ** SETTING: timeline-tslink-info boolean default=off
237 **
238 ** The hyperlink on the timestamp associated with each timeline entry,
239 ** on the far left-hand side of the screen, normally targets another
240 ** /timeline page that shows the entry in context. However, if this
241 ** option is turned on, that hyperlink targets the /info page showing
242
+2 -7
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -101,11 +101,10 @@
101101
#define CMDFLAG_HIDDEN 0x00800 /* Elide from most listings */
102102
#define CMDFLAG_LDAVG_EXEMPT 0x01000 /* Exempt from load_control() */
103103
#define CMDFLAG_ALIAS 0x02000 /* Command aliases */
104104
#define CMDFLAG_KEEPEMPTY 0x04000 /* Do not unset empty settings */
105105
#define CMDFLAG_ABBREVSUBCMD 0x08000 /* Abbreviated subcmd in help text */
106
-#define CMDFLAG_IFCHNG 0x10000 /* Show settting only if not default */
107106
/**************************************************************************/
108107
109108
/*
110109
** Each entry looks like this:
111110
*/
@@ -285,13 +284,10 @@
285284
}else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
286285
aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
287286
}else if( (j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0)
288287
|| (j==12 && strncmp(&zLine[i], "abbrv-subcom", 12)==0) ){
289288
aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
290
- }else if( (j==20 && strncmp(&zLine[i], "show-only-if-changed", 20)==0)
291
- || (j==7 && strncmp(&zLine[i], "if-chng", 7)==0) ){
292
- aEntry[nUsed].eType |= CMDFLAG_IFCHNG;
293289
}else{
294290
fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
295291
zFile, nLine, j, &zLine[i]);
296292
nErr++;
297293
}
@@ -520,23 +516,22 @@
520516
if( zVar ){
521517
printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
522518
}else{
523519
printf(" 0,%*s", 16, "");
524520
}
525
- printf(" %3d, %d, %d, %d, %d, \"%s\"%*s },\n",
521
+ printf(" %3d, %d, %d, %d, \"%s\"%*s },\n",
526522
aEntry[i].iWidth,
527523
(aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
528524
(aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
529525
(aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
530
- (aEntry[i].eType & CMDFLAG_IFCHNG)!=0,
531526
zDef, (int)(10-strlen(zDef)), ""
532527
);
533528
if( aEntry[i].zIf ){
534529
printf("#endif\n");
535530
}
536531
}
537
- printf("{0,0,0,0,0,0,0,0}};\n");
532
+ printf("{0,0,0,0,0,0,0}};\n");
538533
539534
}
540535
541536
/*
542537
** Process a single file of input
543538
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -101,11 +101,10 @@
101 #define CMDFLAG_HIDDEN 0x00800 /* Elide from most listings */
102 #define CMDFLAG_LDAVG_EXEMPT 0x01000 /* Exempt from load_control() */
103 #define CMDFLAG_ALIAS 0x02000 /* Command aliases */
104 #define CMDFLAG_KEEPEMPTY 0x04000 /* Do not unset empty settings */
105 #define CMDFLAG_ABBREVSUBCMD 0x08000 /* Abbreviated subcmd in help text */
106 #define CMDFLAG_IFCHNG 0x10000 /* Show settting only if not default */
107 /**************************************************************************/
108
109 /*
110 ** Each entry looks like this:
111 */
@@ -285,13 +284,10 @@
285 }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
286 aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
287 }else if( (j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0)
288 || (j==12 && strncmp(&zLine[i], "abbrv-subcom", 12)==0) ){
289 aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
290 }else if( (j==20 && strncmp(&zLine[i], "show-only-if-changed", 20)==0)
291 || (j==7 && strncmp(&zLine[i], "if-chng", 7)==0) ){
292 aEntry[nUsed].eType |= CMDFLAG_IFCHNG;
293 }else{
294 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
295 zFile, nLine, j, &zLine[i]);
296 nErr++;
297 }
@@ -520,23 +516,22 @@
520 if( zVar ){
521 printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
522 }else{
523 printf(" 0,%*s", 16, "");
524 }
525 printf(" %3d, %d, %d, %d, %d, \"%s\"%*s },\n",
526 aEntry[i].iWidth,
527 (aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
528 (aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
529 (aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
530 (aEntry[i].eType & CMDFLAG_IFCHNG)!=0,
531 zDef, (int)(10-strlen(zDef)), ""
532 );
533 if( aEntry[i].zIf ){
534 printf("#endif\n");
535 }
536 }
537 printf("{0,0,0,0,0,0,0,0}};\n");
538
539 }
540
541 /*
542 ** Process a single file of input
543
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -101,11 +101,10 @@
101 #define CMDFLAG_HIDDEN 0x00800 /* Elide from most listings */
102 #define CMDFLAG_LDAVG_EXEMPT 0x01000 /* Exempt from load_control() */
103 #define CMDFLAG_ALIAS 0x02000 /* Command aliases */
104 #define CMDFLAG_KEEPEMPTY 0x04000 /* Do not unset empty settings */
105 #define CMDFLAG_ABBREVSUBCMD 0x08000 /* Abbreviated subcmd in help text */
 
106 /**************************************************************************/
107
108 /*
109 ** Each entry looks like this:
110 */
@@ -285,13 +284,10 @@
284 }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
285 aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
286 }else if( (j==23 && strncmp(&zLine[i], "abbreviated-subcommands", 23)==0)
287 || (j==12 && strncmp(&zLine[i], "abbrv-subcom", 12)==0) ){
288 aEntry[nUsed].eType |= CMDFLAG_ABBREVSUBCMD;
 
 
 
289 }else{
290 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
291 zFile, nLine, j, &zLine[i]);
292 nErr++;
293 }
@@ -520,23 +516,22 @@
516 if( zVar ){
517 printf(" \"%s\",%*s", zVar, (int)(15-strlen(zVar)), "");
518 }else{
519 printf(" 0,%*s", 16, "");
520 }
521 printf(" %3d, %d, %d, %d, \"%s\"%*s },\n",
522 aEntry[i].iWidth,
523 (aEntry[i].eType & CMDFLAG_VERSIONABLE)!=0,
524 (aEntry[i].eType & CMDFLAG_BLOCKTEXT)!=0,
525 (aEntry[i].eType & CMDFLAG_SENSITIVE)!=0,
 
526 zDef, (int)(10-strlen(zDef)), ""
527 );
528 if( aEntry[i].zIf ){
529 printf("#endif\n");
530 }
531 }
532 printf("{0,0,0,0,0,0,0}};\n");
533
534 }
535
536 /*
537 ** Process a single file of input
538

Keyboard Shortcuts

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