Fossil SCM

Further cleanup of the documentation for "fossil commit". Deprecate the "--mimetype" option as it is unimplemented (on the display side). Deemphasize unimportant and seldom used aspects of the commit command in order to bring more focus onto the important and often used parts.

drh 2025-03-18 13:01 trunk
Commit 1ec8deef8a7705013edf1e7b9ee57bf5589cfc3a53c772ba27d47755d632785b
2 files changed +31 -49 +4 -1
+31 -49
--- src/checkin.c
+++ src/checkin.c
@@ -2354,37 +2354,25 @@
23542354
** COMMAND: commit
23552355
**
23562356
** Usage: %fossil commit ?OPTIONS? ?FILE...?
23572357
** or: %fossil ci ?OPTIONS? ?FILE...?
23582358
**
2359
-** Create a new version containing all of the changes in the current
2360
-** check-out. You will be prompted to enter a check-in comment unless
2361
-** the comment has been specified on the command-line using "-m" or a
2362
-** file containing the comment using -M. The editor defined in the
2363
-** "editor" fossil option (see %fossil help set) will be used, or from
2364
-** the "VISUAL" or "EDITOR" environment variables (in that order) if
2365
-** no editor is set. Commit message text is interpreted as fossil-wiki
2366
-** format.
2359
+** Create a new check-in containing all of the changes in the current
2360
+** check-out. All changes are committed unless some subset of files
2361
+** is specified on the command line, in which case only the named files
2362
+** become part of the new check-in.
23672363
**
2368
-** All files that have changed will be committed unless some subset of
2369
-** files is specified on the command line.
2364
+** You will be prompted to enter a check-in comment unless the comment
2365
+** has been specified on the command-line using "-m" or "-M". The
2366
+** text editor used is determined by the "editor" setting, or by the
2367
+** "VISUAL" or "EDITOR" environment variables. Commit message text is
2368
+** interpreted as fossil-wiki format. Potentially misformatted check-in
2369
+** comment text is detected and reported unless the --allow-suspect-comment
2370
+** option is used.
23702371
**
23712372
** The --branch option followed by a branch name causes the new
2372
-** check-in to be placed in a newly-created branch with the name
2373
-** passed to the --branch option.
2374
-**
2375
-** Use the --branchcolor option followed by a color name (ex:
2376
-** '#ffc0c0') to specify the background color of entries in the new
2377
-** branch when shown in the web timeline interface. The use of the
2378
-** --branchcolor option is not recommended because user-selected
2379
-** colors may not interact well with all site skins. Instead, let
2380
-** Fossil choose the branch color automatically.
2381
-**
2382
-** The --bgcolor option works like --branchcolor but only sets the
2383
-** background color for a single check-in. Subsequent check-ins
2384
-** revert to the default color. --bgcolor is not recommended for the
2385
-** same reason that --branchcolor is not recommended.
2373
+** check-in to be placed in a newly-created branch with name specified.
23862374
**
23872375
** A check-in is not permitted to fork unless the --allow-fork option
23882376
** appears. An empty check-in (i.e. with nothing changed) is not
23892377
** allowed unless the --allow-empty option appears. A check-in may not
23902378
** be older than its ancestor unless the --allow-older option appears.
@@ -2396,67 +2384,60 @@
23962384
** unless the interactive user chooses to proceed. If there is no
23972385
** interactive user or these warnings should be skipped for some other
23982386
** reason, the --no-warnings option may be used. A check-in is not
23992387
** allowed against a closed leaf.
24002388
**
2401
-** If a commit message is blank, you will be prompted:
2402
-** ("continue (y/N)?") to confirm you really want to commit with a
2403
-** blank commit message. The default value is "N", do not commit.
2404
-**
24052389
** The --private option creates a private check-in that is never synced.
24062390
** Children of private check-ins are automatically private.
24072391
**
24082392
** The --tag option applies the symbolic tag name to the check-in.
2409
-**
2410
-** The --hash option detects edited files by computing each file's
2411
-** artifact hash rather than just checking for changes to its size or mtime.
2393
+** The --tag option can be repeated to assign multiple tags to a check-in.
2394
+** For example: "... --tag release --tag version-1.2.3 ..."
24122395
**
24132396
** Options:
24142397
** --allow-conflict Allow unresolved merge conflicts
24152398
** --allow-empty Allow a commit with no changes
24162399
** --allow-fork Allow the commit to fork
24172400
** --allow-older Allow a commit older than its ancestor
2418
-** --allow-suspect-comment Allow checkin comments that might be misformed
2401
+** --allow-suspect-comment Allow check-in comments that might be misformed
24192402
** --baseline Use a baseline manifest in the commit process
24202403
** --branch NEW-BRANCH-NAME Check in to this new branch
24212404
** --close Close the branch being committed
2422
-** --date-override DATETIME DATE to use instead of 'now'
2405
+** --date-override DATETIME Make DATETIME the time of the check-in.
2406
+** Useful when importing historical check-ins
2407
+** from another version control system.
24232408
** --delta Use a delta manifest in the commit process
24242409
** --hash Verify file status using hashing rather
2425
-** than relying on file mtimes
2410
+** than relying on filesystem mtimes
24262411
** --if-changes Make this command a silent no-op if there
24272412
** are no changes
24282413
** --ignore-clock-skew If a clock skew is detected, ignore it and
24292414
** behave as if the user had entered 'yes' to
24302415
** the question of whether to proceed despite
24312416
** the skew.
24322417
** --ignore-oversize Do not warn the user about oversized files
24332418
** --integrate Close all merged-in branches
2434
-** -m|--comment COMMENT-TEXT Use COMMENT-TEXT as commit comment
2435
-** -M|--message-file FILE Read the commit comment from given file
2436
-** --mimetype MIMETYPE Mimetype of check-in comment
2437
-** -n|--dry-run If given, display instead of run actions
2419
+** -m|--comment COMMENT-TEXT Use COMMENT-TEXT as the check-in comment
2420
+** -M|--message-file FILE Read the check-in comment from FILE
2421
+** -n|--dry-run Do not actually create a new check-in. Just
2422
+** show what would have happened. For debugging.
24382423
** -v|--verbose Show a diff in the commit message prompt
24392424
** --no-prompt This option disables prompting the user for
24402425
** input and assumes an answer of 'No' for every
24412426
** question.
24422427
** --no-warnings Omit all warnings about file contents
24432428
** --no-verify Do not run before-commit hooks
24442429
** --nosign Do not attempt to sign this commit with gpg
24452430
** --nosync Do not auto-sync prior to committing
24462431
** --override-lock Allow a check-in even though parent is locked
2447
-** --private Do not sync changes and their descendants
2432
+** --private Never sync the resulting check-in and make
2433
+** all descendants private too.
24482434
** --proxy PROXY Use PROXY as http proxy during sync operation
2449
-** --tag TAG-NAME Assign given tag TAG-NAME to the check-in
2435
+** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated.
24502436
** --trace Debug tracing
2451
-** --user-override USER USER to use instead of the current default
2452
-**
2453
-** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2454
-** year-month-day form, it may be truncated, the "T" may be replaced by
2455
-** a space, and it may also name a timezone offset from UTC as "-HH:MM"
2456
-** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z"
2457
-** means UTC.
2437
+** --user-override USER Record USER as the login that created the
2438
+** new check-in, rather that the current user.
24582439
**
24592440
** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
24602441
*/
24612442
void commit_cmd(void){
24622443
int hasChanges; /* True if unsaved changes exist */
@@ -2550,17 +2531,18 @@
25502531
noVerify = find_option("no-verify",0,0)!=0;
25512532
bTrace = find_option("trace",0,0)!=0;
25522533
sCiInfo.zBranch = find_option("branch","b",1);
25532534
25542535
/* NB: the --bgcolor and --branchcolor flags still work, but are
2555
- ** now undocumented, to discourage their use. */
2536
+ ** now undocumented, to discourage their use. --mimetype has never
2537
+ ** been used for anything, so also leave it undocumented */
25562538
sCiInfo.zColor = find_option("bgcolor",0,1); /* Deprecated, undocumented*/
25572539
sCiInfo.zBrClr = find_option("branchcolor",0,1); /* Deprecated, undocumented*/
2540
+ sCiInfo.zMimetype = find_option("mimetype",0,1); /* Deprecated, undocumented*/
25582541
25592542
sCiInfo.closeFlag = find_option("close",0,0)!=0;
25602543
sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
2561
- sCiInfo.zMimetype = find_option("mimetype",0,1);
25622544
sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
25632545
while( (zTag = find_option("tag",0,1))!=0 ){
25642546
if( zTag[0]==0 ) continue;
25652547
sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag,
25662548
sizeof(char*)*(nTag+2));
25672549
--- src/checkin.c
+++ src/checkin.c
@@ -2354,37 +2354,25 @@
2354 ** COMMAND: commit
2355 **
2356 ** Usage: %fossil commit ?OPTIONS? ?FILE...?
2357 ** or: %fossil ci ?OPTIONS? ?FILE...?
2358 **
2359 ** Create a new version containing all of the changes in the current
2360 ** check-out. You will be prompted to enter a check-in comment unless
2361 ** the comment has been specified on the command-line using "-m" or a
2362 ** file containing the comment using -M. The editor defined in the
2363 ** "editor" fossil option (see %fossil help set) will be used, or from
2364 ** the "VISUAL" or "EDITOR" environment variables (in that order) if
2365 ** no editor is set. Commit message text is interpreted as fossil-wiki
2366 ** format.
2367 **
2368 ** All files that have changed will be committed unless some subset of
2369 ** files is specified on the command line.
 
 
 
 
 
2370 **
2371 ** The --branch option followed by a branch name causes the new
2372 ** check-in to be placed in a newly-created branch with the name
2373 ** passed to the --branch option.
2374 **
2375 ** Use the --branchcolor option followed by a color name (ex:
2376 ** '#ffc0c0') to specify the background color of entries in the new
2377 ** branch when shown in the web timeline interface. The use of the
2378 ** --branchcolor option is not recommended because user-selected
2379 ** colors may not interact well with all site skins. Instead, let
2380 ** Fossil choose the branch color automatically.
2381 **
2382 ** The --bgcolor option works like --branchcolor but only sets the
2383 ** background color for a single check-in. Subsequent check-ins
2384 ** revert to the default color. --bgcolor is not recommended for the
2385 ** same reason that --branchcolor is not recommended.
2386 **
2387 ** A check-in is not permitted to fork unless the --allow-fork option
2388 ** appears. An empty check-in (i.e. with nothing changed) is not
2389 ** allowed unless the --allow-empty option appears. A check-in may not
2390 ** be older than its ancestor unless the --allow-older option appears.
@@ -2396,67 +2384,60 @@
2396 ** unless the interactive user chooses to proceed. If there is no
2397 ** interactive user or these warnings should be skipped for some other
2398 ** reason, the --no-warnings option may be used. A check-in is not
2399 ** allowed against a closed leaf.
2400 **
2401 ** If a commit message is blank, you will be prompted:
2402 ** ("continue (y/N)?") to confirm you really want to commit with a
2403 ** blank commit message. The default value is "N", do not commit.
2404 **
2405 ** The --private option creates a private check-in that is never synced.
2406 ** Children of private check-ins are automatically private.
2407 **
2408 ** The --tag option applies the symbolic tag name to the check-in.
2409 **
2410 ** The --hash option detects edited files by computing each file's
2411 ** artifact hash rather than just checking for changes to its size or mtime.
2412 **
2413 ** Options:
2414 ** --allow-conflict Allow unresolved merge conflicts
2415 ** --allow-empty Allow a commit with no changes
2416 ** --allow-fork Allow the commit to fork
2417 ** --allow-older Allow a commit older than its ancestor
2418 ** --allow-suspect-comment Allow checkin comments that might be misformed
2419 ** --baseline Use a baseline manifest in the commit process
2420 ** --branch NEW-BRANCH-NAME Check in to this new branch
2421 ** --close Close the branch being committed
2422 ** --date-override DATETIME DATE to use instead of 'now'
 
 
2423 ** --delta Use a delta manifest in the commit process
2424 ** --hash Verify file status using hashing rather
2425 ** than relying on file mtimes
2426 ** --if-changes Make this command a silent no-op if there
2427 ** are no changes
2428 ** --ignore-clock-skew If a clock skew is detected, ignore it and
2429 ** behave as if the user had entered 'yes' to
2430 ** the question of whether to proceed despite
2431 ** the skew.
2432 ** --ignore-oversize Do not warn the user about oversized files
2433 ** --integrate Close all merged-in branches
2434 ** -m|--comment COMMENT-TEXT Use COMMENT-TEXT as commit comment
2435 ** -M|--message-file FILE Read the commit comment from given file
2436 ** --mimetype MIMETYPE Mimetype of check-in comment
2437 ** -n|--dry-run If given, display instead of run actions
2438 ** -v|--verbose Show a diff in the commit message prompt
2439 ** --no-prompt This option disables prompting the user for
2440 ** input and assumes an answer of 'No' for every
2441 ** question.
2442 ** --no-warnings Omit all warnings about file contents
2443 ** --no-verify Do not run before-commit hooks
2444 ** --nosign Do not attempt to sign this commit with gpg
2445 ** --nosync Do not auto-sync prior to committing
2446 ** --override-lock Allow a check-in even though parent is locked
2447 ** --private Do not sync changes and their descendants
 
2448 ** --proxy PROXY Use PROXY as http proxy during sync operation
2449 ** --tag TAG-NAME Assign given tag TAG-NAME to the check-in
2450 ** --trace Debug tracing
2451 ** --user-override USER USER to use instead of the current default
2452 **
2453 ** DATETIME may be "now" or "YYYY-MM-DDTHH:MM:SS.SSS". If in
2454 ** year-month-day form, it may be truncated, the "T" may be replaced by
2455 ** a space, and it may also name a timezone offset from UTC as "-HH:MM"
2456 ** (westward) or "+HH:MM" (eastward). Either no timezone suffix or "Z"
2457 ** means UTC.
2458 **
2459 ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
2460 */
2461 void commit_cmd(void){
2462 int hasChanges; /* True if unsaved changes exist */
@@ -2550,17 +2531,18 @@
2550 noVerify = find_option("no-verify",0,0)!=0;
2551 bTrace = find_option("trace",0,0)!=0;
2552 sCiInfo.zBranch = find_option("branch","b",1);
2553
2554 /* NB: the --bgcolor and --branchcolor flags still work, but are
2555 ** now undocumented, to discourage their use. */
 
2556 sCiInfo.zColor = find_option("bgcolor",0,1); /* Deprecated, undocumented*/
2557 sCiInfo.zBrClr = find_option("branchcolor",0,1); /* Deprecated, undocumented*/
 
2558
2559 sCiInfo.closeFlag = find_option("close",0,0)!=0;
2560 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
2561 sCiInfo.zMimetype = find_option("mimetype",0,1);
2562 sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
2563 while( (zTag = find_option("tag",0,1))!=0 ){
2564 if( zTag[0]==0 ) continue;
2565 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag,
2566 sizeof(char*)*(nTag+2));
2567
--- src/checkin.c
+++ src/checkin.c
@@ -2354,37 +2354,25 @@
2354 ** COMMAND: commit
2355 **
2356 ** Usage: %fossil commit ?OPTIONS? ?FILE...?
2357 ** or: %fossil ci ?OPTIONS? ?FILE...?
2358 **
2359 ** Create a new check-in containing all of the changes in the current
2360 ** check-out. All changes are committed unless some subset of files
2361 ** is specified on the command line, in which case only the named files
2362 ** become part of the new check-in.
 
 
 
 
2363 **
2364 ** You will be prompted to enter a check-in comment unless the comment
2365 ** has been specified on the command-line using "-m" or "-M". The
2366 ** text editor used is determined by the "editor" setting, or by the
2367 ** "VISUAL" or "EDITOR" environment variables. Commit message text is
2368 ** interpreted as fossil-wiki format. Potentially misformatted check-in
2369 ** comment text is detected and reported unless the --allow-suspect-comment
2370 ** option is used.
2371 **
2372 ** The --branch option followed by a branch name causes the new
2373 ** check-in to be placed in a newly-created branch with name specified.
 
 
 
 
 
 
 
 
 
 
 
 
 
2374 **
2375 ** A check-in is not permitted to fork unless the --allow-fork option
2376 ** appears. An empty check-in (i.e. with nothing changed) is not
2377 ** allowed unless the --allow-empty option appears. A check-in may not
2378 ** be older than its ancestor unless the --allow-older option appears.
@@ -2396,67 +2384,60 @@
2384 ** unless the interactive user chooses to proceed. If there is no
2385 ** interactive user or these warnings should be skipped for some other
2386 ** reason, the --no-warnings option may be used. A check-in is not
2387 ** allowed against a closed leaf.
2388 **
 
 
 
 
2389 ** The --private option creates a private check-in that is never synced.
2390 ** Children of private check-ins are automatically private.
2391 **
2392 ** The --tag option applies the symbolic tag name to the check-in.
2393 ** The --tag option can be repeated to assign multiple tags to a check-in.
2394 ** For example: "... --tag release --tag version-1.2.3 ..."
 
2395 **
2396 ** Options:
2397 ** --allow-conflict Allow unresolved merge conflicts
2398 ** --allow-empty Allow a commit with no changes
2399 ** --allow-fork Allow the commit to fork
2400 ** --allow-older Allow a commit older than its ancestor
2401 ** --allow-suspect-comment Allow check-in comments that might be misformed
2402 ** --baseline Use a baseline manifest in the commit process
2403 ** --branch NEW-BRANCH-NAME Check in to this new branch
2404 ** --close Close the branch being committed
2405 ** --date-override DATETIME Make DATETIME the time of the check-in.
2406 ** Useful when importing historical check-ins
2407 ** from another version control system.
2408 ** --delta Use a delta manifest in the commit process
2409 ** --hash Verify file status using hashing rather
2410 ** than relying on filesystem mtimes
2411 ** --if-changes Make this command a silent no-op if there
2412 ** are no changes
2413 ** --ignore-clock-skew If a clock skew is detected, ignore it and
2414 ** behave as if the user had entered 'yes' to
2415 ** the question of whether to proceed despite
2416 ** the skew.
2417 ** --ignore-oversize Do not warn the user about oversized files
2418 ** --integrate Close all merged-in branches
2419 ** -m|--comment COMMENT-TEXT Use COMMENT-TEXT as the check-in comment
2420 ** -M|--message-file FILE Read the check-in comment from FILE
2421 ** -n|--dry-run Do not actually create a new check-in. Just
2422 ** show what would have happened. For debugging.
2423 ** -v|--verbose Show a diff in the commit message prompt
2424 ** --no-prompt This option disables prompting the user for
2425 ** input and assumes an answer of 'No' for every
2426 ** question.
2427 ** --no-warnings Omit all warnings about file contents
2428 ** --no-verify Do not run before-commit hooks
2429 ** --nosign Do not attempt to sign this commit with gpg
2430 ** --nosync Do not auto-sync prior to committing
2431 ** --override-lock Allow a check-in even though parent is locked
2432 ** --private Never sync the resulting check-in and make
2433 ** all descendants private too.
2434 ** --proxy PROXY Use PROXY as http proxy during sync operation
2435 ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated.
2436 ** --trace Debug tracing
2437 ** --user-override USER Record USER as the login that created the
2438 ** new check-in, rather that the current user.
 
 
 
 
 
2439 **
2440 ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
2441 */
2442 void commit_cmd(void){
2443 int hasChanges; /* True if unsaved changes exist */
@@ -2550,17 +2531,18 @@
2531 noVerify = find_option("no-verify",0,0)!=0;
2532 bTrace = find_option("trace",0,0)!=0;
2533 sCiInfo.zBranch = find_option("branch","b",1);
2534
2535 /* NB: the --bgcolor and --branchcolor flags still work, but are
2536 ** now undocumented, to discourage their use. --mimetype has never
2537 ** been used for anything, so also leave it undocumented */
2538 sCiInfo.zColor = find_option("bgcolor",0,1); /* Deprecated, undocumented*/
2539 sCiInfo.zBrClr = find_option("branchcolor",0,1); /* Deprecated, undocumented*/
2540 sCiInfo.zMimetype = find_option("mimetype",0,1); /* Deprecated, undocumented*/
2541
2542 sCiInfo.closeFlag = find_option("close",0,0)!=0;
2543 sCiInfo.integrateFlag = find_option("integrate",0,0)!=0;
 
2544 sCiInfo.verboseFlag = find_option("verbose", "v", 0)!=0;
2545 while( (zTag = find_option("tag",0,1))!=0 ){
2546 if( zTag[0]==0 ) continue;
2547 sCiInfo.azTag = fossil_realloc((void*)sCiInfo.azTag,
2548 sizeof(char*)*(nTag+2));
2549
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -173,11 +173,14 @@
173173
same file as it existed in the parent check-in. If the name of the
174174
file is unchanged from its parent, then the 4th argument is omitted.
175175
176176
A manifest has zero or one <b>N</b> cards. The <b>N</b> card specifies the mimetype for the
177177
text in the comment of the <b>C</b> card. If the <b>N</b> card is omitted, a default mimetype
178
-is used.
178
+is used. Note that the <b>N</b> card has never actually been used by
179
+any Fossil implementation. The implementation has always interpreted
180
+check-in comments according to the [/wiki_rules|Fossil Wiki formatting rules].
181
+There are no current plans to ever change that.
179182
180183
A manifest has zero or one <b>P</b> cards. Most manifests have one <b>P</b> card.
181184
The <b>P</b> card has a varying number of arguments that
182185
define other manifests from which the current manifest
183186
is derived. Each argument is a lowercase
184187
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -173,11 +173,14 @@
173 same file as it existed in the parent check-in. If the name of the
174 file is unchanged from its parent, then the 4th argument is omitted.
175
176 A manifest has zero or one <b>N</b> cards. The <b>N</b> card specifies the mimetype for the
177 text in the comment of the <b>C</b> card. If the <b>N</b> card is omitted, a default mimetype
178 is used.
 
 
 
179
180 A manifest has zero or one <b>P</b> cards. Most manifests have one <b>P</b> card.
181 The <b>P</b> card has a varying number of arguments that
182 define other manifests from which the current manifest
183 is derived. Each argument is a lowercase
184
--- www/fileformat.wiki
+++ www/fileformat.wiki
@@ -173,11 +173,14 @@
173 same file as it existed in the parent check-in. If the name of the
174 file is unchanged from its parent, then the 4th argument is omitted.
175
176 A manifest has zero or one <b>N</b> cards. The <b>N</b> card specifies the mimetype for the
177 text in the comment of the <b>C</b> card. If the <b>N</b> card is omitted, a default mimetype
178 is used. Note that the <b>N</b> card has never actually been used by
179 any Fossil implementation. The implementation has always interpreted
180 check-in comments according to the [/wiki_rules|Fossil Wiki formatting rules].
181 There are no current plans to ever change that.
182
183 A manifest has zero or one <b>P</b> cards. Most manifests have one <b>P</b> card.
184 The <b>P</b> card has a varying number of arguments that
185 define other manifests from which the current manifest
186 is derived. Each argument is a lowercase
187

Keyboard Shortcuts

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