Fossil SCM

Improved user prompt following a verify-comments failure.

drh 2025-03-18 16:08 trunk
Commit 777d962ce5f037cf9bab76f515c2cbcb3e87cdaea2fbb1377305fc75405143ea
1 file changed +7 -5
+7 -5
--- src/checkin.c
+++ src/checkin.c
@@ -2907,22 +2907,24 @@
29072907
29082908
zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'");
29092909
prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag);
29102910
db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
29112911
if( !allowSusCom && suspicious_comment(&comment,&sus) ){
2912
- blob_appendf(&sus, "Edit, abort, or continue (E/a/c)? ");
2912
+ blob_appendf(&sus, "Continue (y/n/E=edit)? ");
29132913
prompt_user(blob_str(&sus), &ans);
29142914
cReply = blob_str(&ans)[0];
29152915
blob_reset(&ans);
29162916
blob_reset(&sus);
2917
- if( cReply=='e' || cReply=='E' ){
2917
+ if( cReply=='n' || cReply=='N' ){
2918
+ fossil_fatal("Commit aborted.");
2919
+ }
2920
+ if( cReply!='y' && cReply!='Y' ){
2921
+ /* "Edit" is the default in case the user enters anything that
2922
+ ** does not start with Y or N - including just hitting return. */
29182923
fossil_free(zInit);
29192924
continue;
29202925
}
2921
- if( cReply!='c' && cReply!='C' ){
2922
- fossil_fatal("Commit aborted.");
2923
- }
29242926
}
29252927
if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
29262928
prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
29272929
cReply = blob_str(&ans)[0];
29282930
blob_reset(&ans);
29292931
--- src/checkin.c
+++ src/checkin.c
@@ -2907,22 +2907,24 @@
2907
2908 zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'");
2909 prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag);
2910 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
2911 if( !allowSusCom && suspicious_comment(&comment,&sus) ){
2912 blob_appendf(&sus, "Edit, abort, or continue (E/a/c)? ");
2913 prompt_user(blob_str(&sus), &ans);
2914 cReply = blob_str(&ans)[0];
2915 blob_reset(&ans);
2916 blob_reset(&sus);
2917 if( cReply=='e' || cReply=='E' ){
 
 
 
 
 
2918 fossil_free(zInit);
2919 continue;
2920 }
2921 if( cReply!='c' && cReply!='C' ){
2922 fossil_fatal("Commit aborted.");
2923 }
2924 }
2925 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
2926 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
2927 cReply = blob_str(&ans)[0];
2928 blob_reset(&ans);
2929
--- src/checkin.c
+++ src/checkin.c
@@ -2907,22 +2907,24 @@
2907
2908 zInit = db_text(0,"SELECT value FROM vvar WHERE name='ci-comment'");
2909 prepare_commit_comment(&comment, zInit, &sCiInfo, vid, dryRunFlag);
2910 db_multi_exec("REPLACE INTO vvar VALUES('ci-comment',%B)", &comment);
2911 if( !allowSusCom && suspicious_comment(&comment,&sus) ){
2912 blob_appendf(&sus, "Continue (y/n/E=edit)? ");
2913 prompt_user(blob_str(&sus), &ans);
2914 cReply = blob_str(&ans)[0];
2915 blob_reset(&ans);
2916 blob_reset(&sus);
2917 if( cReply=='n' || cReply=='N' ){
2918 fossil_fatal("Commit aborted.");
2919 }
2920 if( cReply!='y' && cReply!='Y' ){
2921 /* "Edit" is the default in case the user enters anything that
2922 ** does not start with Y or N - including just hitting return. */
2923 fossil_free(zInit);
2924 continue;
2925 }
 
 
 
2926 }
2927 if( zInit && zInit[0] && fossil_strcmp(zInit, blob_str(&comment))==0 ){
2928 prompt_user("unchanged check-in comment. continue (y/N)? ", &ans);
2929 cReply = blob_str(&ans)[0];
2930 blob_reset(&ans);
2931

Keyboard Shortcuts

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