| | @@ -1377,11 +1377,14 @@ |
| 1377 | 1377 | ** allowed against a closed leaf. |
| 1378 | 1378 | ** |
| 1379 | 1379 | ** The --private option creates a private check-in that is never synced. |
| 1380 | 1380 | ** Children of private check-ins are automatically private. |
| 1381 | 1381 | ** |
| 1382 | | -** the --tag option applies the symbolic tag name to the check-in. |
| 1382 | +** The --tag option applies the symbolic tag name to the check-in. |
| 1383 | +** |
| 1384 | +** The --sha1sum option detects edited files by computing each file's |
| 1385 | +** SHA1 hash rather than just checking for changes to its size or mtime. |
| 1383 | 1386 | ** |
| 1384 | 1387 | ** Options: |
| 1385 | 1388 | ** --allow-conflict allow unresolved merge conflicts |
| 1386 | 1389 | ** --allow-empty allow a commit with no changes |
| 1387 | 1390 | ** --allow-fork allow the commit to fork |
| | @@ -1397,10 +1400,12 @@ |
| 1397 | 1400 | ** --mimetype MIMETYPE mimetype of check-in comment |
| 1398 | 1401 | ** -n|--dry-run If given, display instead of run actions |
| 1399 | 1402 | ** --no-warnings omit all warnings about file contents |
| 1400 | 1403 | ** --nosign do not attempt to sign this commit with gpg |
| 1401 | 1404 | ** --private do not sync changes and their descendants |
| 1405 | +** --sha1sum verify file status using SHA1 hashing rather |
| 1406 | +** than relying on file mtimes |
| 1402 | 1407 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1403 | 1408 | ** |
| 1404 | 1409 | ** See also: branch, changes, checkout, extra, sync |
| 1405 | 1410 | */ |
| 1406 | 1411 | void commit_cmd(void){ |
| | @@ -1410,10 +1415,11 @@ |
| 1410 | 1415 | int nvid; /* Blob-id of the new check-in */ |
| 1411 | 1416 | Blob comment; /* Check-in comment */ |
| 1412 | 1417 | const char *zComment; /* Check-in comment */ |
| 1413 | 1418 | Stmt q; /* Various queries */ |
| 1414 | 1419 | char *zUuid; /* UUID of the new check-in */ |
| 1420 | + int useSha1sum = 0; /* True to verify file status using SHA1 hashing */ |
| 1415 | 1421 | int noSign = 0; /* True to omit signing the manifest using GPG */ |
| 1416 | 1422 | int isAMerge = 0; /* True if checking in a merge */ |
| 1417 | 1423 | int noWarningFlag = 0; /* True if skipping all warnings */ |
| 1418 | 1424 | int forceFlag = 0; /* Undocumented: Disables all checks */ |
| 1419 | 1425 | int forceDelta = 0; /* Force a delta-manifest */ |
| | @@ -1441,10 +1447,11 @@ |
| 1441 | 1447 | Blob ans; |
| 1442 | 1448 | char cReply; |
| 1443 | 1449 | |
| 1444 | 1450 | memset(&sCiInfo, 0, sizeof(sCiInfo)); |
| 1445 | 1451 | url_proxy_options(); |
| 1452 | + useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| 1446 | 1453 | noSign = find_option("nosign",0,0)!=0; |
| 1447 | 1454 | forceDelta = find_option("delta",0,0)!=0; |
| 1448 | 1455 | forceBaseline = find_option("baseline",0,0)!=0; |
| 1449 | 1456 | if( forceDelta && forceBaseline ){ |
| 1450 | 1457 | fossil_fatal("cannot use --delta and --baseline together"); |
| | @@ -1586,11 +1593,11 @@ |
| 1586 | 1593 | */ |
| 1587 | 1594 | if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){ |
| 1588 | 1595 | fossil_fatal("no such user: %s", g.zLogin); |
| 1589 | 1596 | } |
| 1590 | 1597 | |
| 1591 | | - hasChanges = unsaved_changes(); |
| 1598 | + hasChanges = unsaved_changes(useSha1sum ? CKSIG_SHA1 : 0); |
| 1592 | 1599 | db_begin_transaction(); |
| 1593 | 1600 | db_record_repository_filename(0); |
| 1594 | 1601 | if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){ |
| 1595 | 1602 | fossil_fatal("nothing has changed; use --allow-empty to override"); |
| 1596 | 1603 | } |
| 1597 | 1604 | |