Fossil

Check-in [072125b0ec]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplify the verify-comments setting to have just "on", "off", and "preview" options. Rename the function that implements this feature to "verify_comment()". Reimplement that function so that it uses the new error reporting mechanism in wiki_convert().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 072125b0ecd047c9184ae83f0974065d56cbea3b87d344a9b797ac2918ec63f8
User & Date: drh 2025-03-22 09:38:45.039
Context
2025-03-22
10:38
Delete the timeline-block-markup setting, and all the complication that goes with it. Due to a bug [/info/2020-06-02T17:38z|introduced on 2020-06-02], Fossil has behaved as if that setting where always "on", regardless of its actual value, and nobody has complained. Hence, we surmise that the setting is not needed. Ref: [forum:/forumpost/9adfe7e46b2441ae|forum post 9adfe7e46b2] check-in: 0432c38df6 user: drh tags: trunk
09:38
Simplify the verify-comments setting to have just "on", "off", and "preview" options. Rename the function that implements this feature to "verify_comment()". Reimplement that function so that it uses the new error reporting mechanism in wiki_convert(). check-in: 072125b0ec user: drh tags: trunk
2025-03-21
23:29
Work around missing BIO_set_conn_ip_family() API in LibreSSL. This fixes [forum:/forumpost/a52cbed8f228397e|forum post a52cbed8f], I'm told. check-in: 50ff741f6f user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/checkin.c.
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304

2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318

2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375


2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411

2412
2413
2414
2415

2416
2417
2418
2419
2420
2421
2422
2423
2424
/*
** SETTING: verify-comments                              width=8 default=on
**
** This setting determines how much sanity checking, if any, the 
** "fossil commit" and "fossil amend" commands do against check-in
** comments. Recognized values:
**
**     on             (Default) Check for bad syntax in check-in comments
**                    and offer the user a chance to continue editing for
**                    interactive sessions, or simply abort the commit if
**                    commit was entered using -m or -M
**
**     off            Do not do syntax checking of any kind
**
**     links          Similar to "on", except only check for bad hyperlinks
**
**     preview        Do all the same checks as "on" but also preview the
**                    check-in comment to the user during interactive sessions

**                    and provide an opportunity to accept or re-edit
*/

#if INTERFACE
#define COMCK_LINKS     0x01     /* Check for back hyperlinks */
#define COMCK_MARKUP    0x02     /* Check markup */
#define COMCK_PREVIEW   0x04     /* Always preview, even if no issues found */
#define COMCK_NOPREVIEW 0x08     /* Never preview, even for other errors */
#endif /* INTERFACE */

/*
** Check for possible formatting errors in the comment string pComment.
**
** If concerns are found, write a description of the problem(s) to

** stdout and return non-zero.  The return value is some combination
** of the COMCK_* flags, depending on what went wrong.
**
** If no issues are seen, do not output anything and return zero.
*/
int suspicious_comment(Blob *pComment, int mFlags){
  char *zStart = blob_str(pComment);
  char *z;
  char *zEnd, *zEnd2;
  char *zSep;
  char cSave1;
  int nIssue = 0;
  int rc = mFlags & COMCK_PREVIEW;
  Blob out;
  static const char zSpecial[] = "\\&<*_`[";

  if( mFlags==0 ) return 0;
  z = zStart;
  blob_init(&out, 0, 0);
  if( mFlags & COMCK_LINKS ){
    while( (z = strchr(z,'['))!=0 ){
      zEnd = strchr(z,']');
      if( zEnd==0 ){
        blob_appendf(&out,"\n (%d) ", ++nIssue);
        blob_appendf(&out, "Unterminated hyperlink \"%.12s...\"", z);
        break;
      }
      if( zEnd[1]=='(' && (zEnd2 = strchr(zEnd,')'))!=0 ){
        blob_appendf(&out,"\n (%d) ", ++nIssue);
        blob_appendf(&out, "Markdown hyperlink syntax: %.*s",
                     (int)(zEnd2+1-z), z);
        z = zEnd2;
        continue;
      }
      zSep = strchr(z+1,'|');
      if( zSep==0 || zSep>zEnd ) zSep = zEnd;
      while( zSep>z && fossil_isspace(zSep[-1]) ) zSep--;
      cSave1 = zSep[0];
      zSep[0] = 0;
      if( !wiki_valid_link_target(z+1) ){
        blob_appendf(&out,"\n (%d) ", ++nIssue);
        blob_appendf(&out, "Broken hyperlink: [%s]", z+1);
      }
      zSep[0] = cSave1;
      z = zEnd;
    }
  }

  if( nIssue>0
   || (mFlags & COMCK_PREVIEW)!=0
   || ((mFlags & COMCK_MARKUP)!=0 && strcspn(zStart,zSpecial)<strlen(zStart))
  ){
    char zGot[16];
    int nGot = 0;
    int i;
    if( (mFlags & COMCK_MARKUP)!=0 ){
      for(i=0; zSpecial[i]; i++){


        if( strchr(zStart,zSpecial[i]) ) zGot[nGot++] = zSpecial[i];
      }
    }
    zGot[nGot] = 0;
    if( nGot>0 ) rc |= COMCK_MARKUP;
    if( nGot>0 && nIssue>0 ){
      blob_appendf(&out,"\n (%d) Comment uses special character%s \"%s\"",
                   ++nIssue, (nGot>1 ? "s" : ""), zGot);
      nGot = 0;
    }
    if( nIssue ){
      rc |= COMCK_LINKS;
      fossil_print(
        "Possible comment formatting error%s:%b\n",
        nIssue>1 ? "s" : "", &out
      );
    }
    if( (mFlags & COMCK_NOPREVIEW)==0 ){
      Blob in, html, txt;
      blob_init(&in, blob_str(pComment), -1);
      blob_init(&html, 0, 0);
      blob_init(&txt, 0, 0);
      wiki_convert(&in, &html, WIKI_INLINE);
      html_to_plaintext(blob_str(&html), &txt, HTOT_VT100);
      if( nGot>0 ){
        fossil_print(
          "The comment uses special character%s \"%s\". "
          "Does it render as you expect?\n\n   ",
          (nGot>1 ? "s" : ""), zGot
        );
      }else{
        fossil_print("Preview of the check-in comment:\n\n   ");
      }
      comment_print(blob_str(&txt), 0, 3, -1, get_comment_format());
      blob_reset(&in);
      blob_reset(&html);

      blob_reset(&txt);
    }
  }
  blob_reset(&out);

  return rc;
}

/*
** COMMAND: ci#
** COMMAND: commit
**
** Usage: %fossil commit ?OPTIONS? ?FILE...?
**    or: %fossil ci ?OPTIONS? ?FILE...?







|
|
|
|

|

<
<
|
|
>
|



<
|
|
<





|
>
|
|



|
|
<
<
<
<
|

|
<


|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
|
|
|
<
|
|
|
<
>
>
<
<
<
<
|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
|
<
>
|
|
<
|
>

|







2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300


2301
2302
2303
2304
2305
2306
2307

2308
2309

2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323




2324
2325
2326

2327
2328
2329
2330
2331
























2332


2333

2334
2335
2336

2337
2338
2339

2340
2341




2342







2343

















2344
2345
2346
2347
2348

2349
2350
2351

2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
/*
** SETTING: verify-comments                              width=8 default=on
**
** This setting determines how much sanity checking, if any, the 
** "fossil commit" and "fossil amend" commands do against check-in
** comments. Recognized values:
**
**     on         (Default) Check for bad syntax and/or broken hyperlinks
**                in check-in comments and offer the user a chance to
**                continue editing for interactive sessions, or simply
**                abort the commit if the comment was entered using -m or -M
**
**     off        Do not do syntax checking of any kind
**


**     preview    Do all the same checks as "on" but also always preview the
**                check-in comment to the user during interactive sessions
**                even if no obvious errors are found, and provide an
**                opportunity to accept or re-edit
*/

#if INTERFACE

#define COMCK_MARKUP    0x01  /* Check for mistakes */
#define COMCK_PREVIEW   0x02  /* Always preview, even if no issues found */

#endif /* INTERFACE */

/*
** Check for possible formatting errors in the comment string pComment.
**
** If issues are found, write an appropriate error notice, probably also
** including the complete text of the comment formatted to highlight the
** problem, to stdout and return non-zero.  The return value is some
** combination of the COMCK_* flags, depending on what went wrong.
**
** If no issues are seen, do not output anything and return zero.
*/
int verify_comment(Blob *pComment, int mFlags){
  Blob in, html;




  int mResult;
  int rc = mFlags & COMCK_PREVIEW;
  int wFlags;


  if( mFlags==0 ) return 0;
  blob_init(&in, blob_str(pComment), -1);
  blob_init(&html, 0, 0);
  wFlags = wiki_convert_flags(0);
























  wFlags &= WIKI_NOBADLINKS;


  wFlags |= WIKI_MARK;

  mResult = wiki_convert(&in, &html, wFlags);
  if( mResult & RENDER_ANYERROR ) rc |= COMCK_MARKUP;
  if( rc ){

    int htot = HTOT_NO_WS;
    Blob txt;
    if( terminal_is_vt100() ) htot |= HTOT_VT100;

    blob_init(&txt, 0, 0);
    html_to_plaintext(blob_str(&html), &txt, htot);




    if( rc & COMCK_MARKUP ){







      fossil_print("Possible format errors in the check-in comment:\n\n   ");

















    }else{
      fossil_print("Preview of the check-in comment:\n\n   ");
    }
    comment_print(blob_str(&txt), 0, 3, -1, get_comment_format());
    fossil_print("\n");

    fflush(stdout);
    blob_reset(&txt);
  }

  blob_reset(&html);
  blob_reset(&in);
  return rc;
} 

/*
** COMMAND: ci#
** COMMAND: commit
**
** Usage: %fossil commit ?OPTIONS? ?FILE...?
**    or: %fossil ci ?OPTIONS? ?FILE...?
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
  Blob ans;              /* Answer to continuation prompts */
  char cReply;           /* First character of ans */
  int bRecheck = 0;      /* Repeat fork and closed-branch checks*/
  int bIgnoreSkew = 0;   /* --ignore-clock-skew flag */
  int mxSize;
  char *zCurBranch = 0;  /* The current branch name of checkout */
  char *zNewBranch = 0;  /* The branch name after update */
  int ckComFlgs;         /* Flags passed to suspicious_comment() */

  memset(&sCiInfo, 0, sizeof(sCiInfo));
  url_proxy_options();
  /* --sha1sum is an undocumented alias for --hash for backwards compatiblity */
  useHash = find_option("hash",0,0)!=0 || find_option("sha1sum",0,0)!=0;
  noSign = find_option("nosign",0,0)!=0;
  if( find_option("nosync",0,0) ) g.fNoSync = 1;







|







2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
  Blob ans;              /* Answer to continuation prompts */
  char cReply;           /* First character of ans */
  int bRecheck = 0;      /* Repeat fork and closed-branch checks*/
  int bIgnoreSkew = 0;   /* --ignore-clock-skew flag */
  int mxSize;
  char *zCurBranch = 0;  /* The current branch name of checkout */
  char *zNewBranch = 0;  /* The branch name after update */
  int ckComFlgs;         /* Flags passed to verify_comment() */

  memset(&sCiInfo, 0, sizeof(sCiInfo));
  url_proxy_options();
  /* --sha1sum is an undocumented alias for --hash for backwards compatiblity */
  useHash = find_option("hash",0,0)!=0 || find_option("sha1sum",0,0)!=0;
  noSign = find_option("nosign",0,0)!=0;
  if( find_option("nosync",0,0) ) g.fNoSync = 1;
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
    if( noVerifyCom ){
      ckComFlgs = 0;
    }else{
      const char *zVerComs = db_get("verify-comments","on");
      if( is_false(zVerComs) ){
        ckComFlgs = 0;
      }else if( strcmp(zVerComs,"preview")==0 ){
        ckComFlgs = COMCK_PREVIEW | COMCK_LINKS | COMCK_MARKUP;
      }else if( strcmp(zVerComs,"links")==0 ){
        ckComFlgs = COMCK_LINKS;
      }else{
        ckComFlgs = COMCK_LINKS | COMCK_MARKUP;
      }
    }

    /* Get the check-in comment.  This might involve prompting the
    ** user for the check-in comment, in which case we should resync
    ** to renew the check-in lock and repeat the checks for conflicts.
    */
    if( zComment ){
      blob_zero(&comment);
      blob_append(&comment, zComment, -1);
      ckComFlgs &= ~(COMCK_PREVIEW|COMCK_MARKUP);
      ckComFlgs |= COMCK_NOPREVIEW;
      if( suspicious_comment(&comment, ckComFlgs) ){
        fossil_fatal("Commit aborted; "
                     "use --no-verify-comment to override");
      }
    }else if( zComFile ){
      blob_zero(&comment);
      blob_read_from_file(&comment, zComFile, ExtFILE);
      blob_to_utf8_no_bom(&comment, 1);
      ckComFlgs &= ~(COMCK_PREVIEW|COMCK_MARKUP);
      ckComFlgs |= COMCK_NOPREVIEW;
      if( suspicious_comment(&comment, ckComFlgs) ){
        fossil_fatal("Commit aborted; "
                     "use --no-verify-comment to override");
      }
    }else if( !noPrompt ){
      while(  1/*exit-by-break*/ ){
        int rc;
        char *zInit;
        zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'");
        prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag);
        db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
        if( (rc = suspicious_comment(&comment, ckComFlgs))!=0 ){
          if( rc==COMCK_PREVIEW ){
            prompt_user("\nContinue (Y/n/e=edit)? ", &ans);
          }else{
            prompt_user("\nContinue (y/n/E=edit)? ", &ans);
          }
          cReply = blob_str(&ans)[0];
          cReply = fossil_tolower(cReply);
          blob_reset(&ans);
          if( cReply=='n' ){
            fossil_fatal("Commit aborted.");
          }
          if( cReply=='e' || (cReply!='y' && rc!=COMCK_PREVIEW) ){
            fossil_free(zInit);
            continue;
          }
        }
        if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
          prompt_user("unchanged check-in comment.  continue (y/N)? ", &ans);
          cReply = blob_str(&ans)[0];







|
<
<

|










|
<
|







|
<
|










|

|

|




|


|







2864
2865
2866
2867
2868
2869
2870
2871


2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884

2885
2886
2887
2888
2889
2890
2891
2892
2893

2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
    if( noVerifyCom ){
      ckComFlgs = 0;
    }else{
      const char *zVerComs = db_get("verify-comments","on");
      if( is_false(zVerComs) ){
        ckComFlgs = 0;
      }else if( strcmp(zVerComs,"preview")==0 ){
        ckComFlgs = COMCK_PREVIEW | COMCK_MARKUP;


      }else{
        ckComFlgs = COMCK_MARKUP;
      }
    }

    /* Get the check-in comment.  This might involve prompting the
    ** user for the check-in comment, in which case we should resync
    ** to renew the check-in lock and repeat the checks for conflicts.
    */
    if( zComment ){
      blob_zero(&comment);
      blob_append(&comment, zComment, -1);
      ckComFlgs &= ~COMCK_PREVIEW;

      if( verify_comment(&comment, ckComFlgs) ){
        fossil_fatal("Commit aborted; "
                     "use --no-verify-comment to override");
      }
    }else if( zComFile ){
      blob_zero(&comment);
      blob_read_from_file(&comment, zComFile, ExtFILE);
      blob_to_utf8_no_bom(&comment, 1);
      ckComFlgs &= ~COMCK_PREVIEW;

      if( verify_comment(&comment, ckComFlgs) ){
        fossil_fatal("Commit aborted; "
                     "use --no-verify-comment to override");
      }
    }else if( !noPrompt ){
      while(  1/*exit-by-break*/ ){
        int rc;
        char *zInit;
        zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'");
        prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag);
        db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
        if( (rc = verify_comment(&comment, ckComFlgs))!=0 ){
          if( rc==COMCK_PREVIEW ){
            prompt_user("Continue, abort, or edit? (C/a/e)? ", &ans);
          }else{
            prompt_user("Edit, abort, or continue (E/a/c)? ", &ans);
          }
          cReply = blob_str(&ans)[0];
          cReply = fossil_tolower(cReply);
          blob_reset(&ans);
          if( cReply=='a' ){
            fossil_fatal("Commit aborted.");
          }
          if( cReply=='e' || (cReply!='c' && rc!=COMCK_PREVIEW) ){
            fossil_free(zInit);
            continue;
          }
        }
        if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
          prompt_user("unchanged check-in comment.  continue (y/N)? ", &ans);
          cReply = blob_str(&ans)[0];
Changes to src/info.c.
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
  const char *zUuid;
  Blob ctrl;
  Blob comment;
  char *zNow;
  int nTags, nCancels;
  int i;
  Stmt q;
  int ckComFlgs;                /* Flags passed to suspicious_comment() */


  fEditComment = find_option("edit-comment","e",0)!=0;
  zNewComment = find_option("comment","m",1);
  zComFile = find_option("message-file","M",1);
  zNewBranch = find_option("branch",0,1);
  zNewColor = find_option("bgcolor",0,1);







|







3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
  const char *zUuid;
  Blob ctrl;
  Blob comment;
  char *zNow;
  int nTags, nCancels;
  int i;
  Stmt q;
  int ckComFlgs;                /* Flags passed to verify_comment() */


  fEditComment = find_option("edit-comment","e",0)!=0;
  zNewComment = find_option("comment","m",1);
  zComFile = find_option("message-file","M",1);
  zNewBranch = find_option("branch",0,1);
  zNewColor = find_option("bgcolor",0,1);
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
    if( noVerifyCom ){
      ckComFlgs = 0;
    }else{
      const char *zVerComs = db_get("verify-comments","on");
      if( is_false(zVerComs) ){
        ckComFlgs = 0;
      }else if( strcmp(zVerComs,"preview")==0 ){
        ckComFlgs = COMCK_PREVIEW | COMCK_LINKS | COMCK_MARKUP;
      }else if( strcmp(zVerComs,"links")==0 ){
        ckComFlgs = COMCK_LINKS;
      }else{
        ckComFlgs = COMCK_LINKS | COMCK_MARKUP;
      }
      if( zNewComment || zComFile ){
        ckComFlgs = (ckComFlgs & COMCK_LINKS) | COMCK_NOPREVIEW;
      }
    }
    if( fEditComment ){
      prepare_amend_comment(&comment, zComment, zUuid);
    }else if( zComFile ){
      blob_read_from_file(&comment, zComFile, ExtFILE);
      blob_to_utf8_no_bom(&comment, 1);
    }else if( zNewComment ){
      blob_init(&comment, zNewComment, -1);
    }
    if( blob_size(&comment)>0
     && comment_compare(zComment, blob_str(&comment))==0
    ){
      int rc;
      while( (rc = suspicious_comment(&comment, ckComFlgs))!=0 ){
        char cReply;
        Blob ans;
        if( !fEditComment ){
          fossil_fatal("Amend aborted; "
                       "use --no-verify-comment to override");
        }
        if( rc==COMCK_PREVIEW ){
          prompt_user("\nContinue (Y/n/e=edit)? ", &ans);
        }else{
          prompt_user("\nContinue (y/n/E=edit)? ", &ans);
        }
        cReply = blob_str(&ans)[0];
        cReply = fossil_tolower(cReply);
        blob_reset(&ans);
        if( cReply=='n' ){
          fossil_fatal("Amend aborted.");
        }
        if( cReply=='e' || (cReply!='y' && rc!=COMCK_PREVIEW) ){
          char *zPrior = blob_materialize(&comment);
          blob_init(&comment, 0, 0);
          prepare_amend_comment(&comment, zPrior, zUuid);
          fossil_free(zPrior);
          continue;
        }else{
          break;







|
<
<

|
<
<
<














|







|

|




|


|







4028
4029
4030
4031
4032
4033
4034
4035


4036
4037



4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
    if( noVerifyCom ){
      ckComFlgs = 0;
    }else{
      const char *zVerComs = db_get("verify-comments","on");
      if( is_false(zVerComs) ){
        ckComFlgs = 0;
      }else if( strcmp(zVerComs,"preview")==0 ){
        ckComFlgs = COMCK_PREVIEW | COMCK_MARKUP;


      }else{
        ckComFlgs = COMCK_MARKUP;



      }
    }
    if( fEditComment ){
      prepare_amend_comment(&comment, zComment, zUuid);
    }else if( zComFile ){
      blob_read_from_file(&comment, zComFile, ExtFILE);
      blob_to_utf8_no_bom(&comment, 1);
    }else if( zNewComment ){
      blob_init(&comment, zNewComment, -1);
    }
    if( blob_size(&comment)>0
     && comment_compare(zComment, blob_str(&comment))==0
    ){
      int rc;
      while( (rc = verify_comment(&comment, ckComFlgs))!=0 ){
        char cReply;
        Blob ans;
        if( !fEditComment ){
          fossil_fatal("Amend aborted; "
                       "use --no-verify-comment to override");
        }
        if( rc==COMCK_PREVIEW ){
          prompt_user("Continue, abort, or edit (C/a/e)? ", &ans);
        }else{
          prompt_user("Edit, abort, or continue (E/a/c)? ", &ans);
        }
        cReply = blob_str(&ans)[0];
        cReply = fossil_tolower(cReply);
        blob_reset(&ans);
        if( cReply=='a' ){
          fossil_fatal("Amend aborted.");
        }
        if( cReply=='e' || (cReply!='c' && rc!=COMCK_PREVIEW) ){
          char *zPrior = blob_materialize(&comment);
          blob_init(&comment, 0, 0);
          prepare_amend_comment(&comment, zPrior, zUuid);
          fossil_free(zPrior);
          continue;
        }else{
          break;
Changes to src/printf.c.
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
** configuration parameters.
**
** The altForm2 argument is true for "%!W" (with the "!" alternate-form-2
** flags) and is false for plain "%W".  The ! indicates that the text is
** to be rendered on a form rather than the timeline and that block markup
** is acceptable even if the "timeline-block-markup" setting is false.
*/
static int wiki_convert_flags(int altForm2){
  static int wikiFlags = 0;
  if( wikiFlags==0 ){
    if( db_get_boolean("timeline-block-markup", 0) ){
      wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
    }else{
      wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
    }







|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
** configuration parameters.
**
** The altForm2 argument is true for "%!W" (with the "!" alternate-form-2
** flags) and is false for plain "%W".  The ! indicates that the text is
** to be rendered on a form rather than the timeline and that block markup
** is acceptable even if the "timeline-block-markup" setting is false.
*/
int wiki_convert_flags(int altForm2){
  static int wikiFlags = 0;
  if( wikiFlags==0 ){
    if( db_get_boolean("timeline-block-markup", 0) ){
      wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
    }else{
      wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
    }