Fossil SCM

Change the --sha1sum options on "fossil commit" and "fossil status" to be --hash, since it is no longer restricted to a single hash algorithm.

drh 2017-02-28 16:36 fossil-2.0
Commit 1f61b2dc88ebca720f26ab116b1d3248ce6c7075
2 files changed +9 -9 +2 -2
+9 -9
--- src/checkin.c
+++ src/checkin.c
@@ -412,11 +412,11 @@
412412
**
413413
** General options:
414414
** --abs-paths Display absolute pathnames.
415415
** --rel-paths Display pathnames relative to the current working
416416
** directory.
417
-** --sha1sum Verify file status using SHA1 hashing rather than
417
+** --hash Verify file status using hashing rather than
418418
** relying on file mtimes.
419419
** --case-sensitive <BOOL> Override case-sensitive setting.
420420
** --dotfiles Include unmanaged files beginning with a dot.
421421
** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422422
** --no-dir-symlinks Disables support for directory symlinks.
@@ -464,11 +464,11 @@
464464
{"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY },
465465
};
466466
467467
Blob report = BLOB_INITIALIZER;
468468
enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES;
469
- int useSha1sum = find_option("sha1sum", 0, 0)!=0;
469
+ int useHash = find_option("hash", 0, 0)!=0;
470470
int showHdr = command==CHANGES && find_option("header", 0, 0);
471471
int verboseFlag = command==CHANGES && find_option("verbose", "v", 0);
472472
const char *zIgnoreFlag = find_option("ignore", 0, 1);
473473
unsigned scanFlags = 0;
474474
unsigned flags = 0;
@@ -528,11 +528,11 @@
528528
529529
/* We should be done with options. */
530530
verify_all_options();
531531
532532
/* Check for changed files. */
533
- vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0);
533
+ vfile_check_signature(vid, useHash ? CKSIG_HASH : 0);
534534
535535
/* Search for unmanaged files if requested. */
536536
if( flags & C_EXTRA ){
537537
Glob *pIgnore = glob_create(zIgnoreFlag);
538538
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
@@ -1985,12 +1985,12 @@
19851985
** The --private option creates a private check-in that is never synced.
19861986
** Children of private check-ins are automatically private.
19871987
**
19881988
** The --tag option applies the symbolic tag name to the check-in.
19891989
**
1990
-** The --sha1sum option detects edited files by computing each file's
1991
-** SHA1 hash rather than just checking for changes to its size or mtime.
1990
+** The --hash option detects edited files by computing each file's
1991
+** artifact hash rather than just checking for changes to its size or mtime.
19921992
**
19931993
** Options:
19941994
** --allow-conflict allow unresolved merge conflicts
19951995
** --allow-empty allow a commit with no changes
19961996
** --allow-fork allow the commit to fork
@@ -2010,11 +2010,11 @@
20102010
** input and assumes an answer of 'No' for every
20112011
** question.
20122012
** --no-warnings omit all warnings about file contents
20132013
** --nosign do not attempt to sign this commit with gpg
20142014
** --private do not sync changes and their descendants
2015
-** --sha1sum verify file status using SHA1 hashing rather
2015
+** --hash verify file status using hashing rather
20162016
** than relying on file mtimes
20172017
** --tag TAG-NAME assign given tag TAG-NAME to the check-in
20182018
** --date-override DATETIME DATE to use instead of 'now'
20192019
** --user-override USER USER to use instead of the current default
20202020
**
@@ -2033,11 +2033,11 @@
20332033
int nvid; /* Blob-id of the new check-in */
20342034
Blob comment; /* Check-in comment */
20352035
const char *zComment; /* Check-in comment */
20362036
Stmt q; /* Various queries */
20372037
char *zUuid; /* UUID of the new check-in */
2038
- int useSha1sum = 0; /* True to verify file status using SHA1 hashing */
2038
+ int useHash = 0; /* True to verify file status using SHA1 hashing */
20392039
int noSign = 0; /* True to omit signing the manifest using GPG */
20402040
int isAMerge = 0; /* True if checking in a merge */
20412041
int noWarningFlag = 0; /* True if skipping all warnings */
20422042
int noPrompt = 0; /* True if skipping all prompts */
20432043
int forceFlag = 0; /* Undocumented: Disables all checks */
@@ -2068,11 +2068,11 @@
20682068
Blob ans;
20692069
char cReply;
20702070
20712071
memset(&sCiInfo, 0, sizeof(sCiInfo));
20722072
url_proxy_options();
2073
- useSha1sum = find_option("sha1sum", 0, 0)!=0;
2073
+ useHash = find_option("hash", 0, 0)!=0;
20742074
noSign = find_option("nosign",0,0)!=0;
20752075
forceDelta = find_option("delta",0,0)!=0;
20762076
forceBaseline = find_option("baseline",0,0)!=0;
20772077
if( forceDelta && forceBaseline ){
20782078
fossil_fatal("cannot use --delta and --baseline together");
@@ -2232,11 +2232,11 @@
22322232
*/
22332233
if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){
22342234
fossil_fatal("no such user: %s", g.zLogin);
22352235
}
22362236
2237
- hasChanges = unsaved_changes(useSha1sum ? CKSIG_SHA1 : 0);
2237
+ hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0);
22382238
db_begin_transaction();
22392239
db_record_repository_filename(0);
22402240
if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){
22412241
fossil_fatal("nothing has changed; use --allow-empty to override");
22422242
}
22432243
--- src/checkin.c
+++ src/checkin.c
@@ -412,11 +412,11 @@
412 **
413 ** General options:
414 ** --abs-paths Display absolute pathnames.
415 ** --rel-paths Display pathnames relative to the current working
416 ** directory.
417 ** --sha1sum Verify file status using SHA1 hashing rather than
418 ** relying on file mtimes.
419 ** --case-sensitive <BOOL> Override case-sensitive setting.
420 ** --dotfiles Include unmanaged files beginning with a dot.
421 ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422 ** --no-dir-symlinks Disables support for directory symlinks.
@@ -464,11 +464,11 @@
464 {"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY },
465 };
466
467 Blob report = BLOB_INITIALIZER;
468 enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES;
469 int useSha1sum = find_option("sha1sum", 0, 0)!=0;
470 int showHdr = command==CHANGES && find_option("header", 0, 0);
471 int verboseFlag = command==CHANGES && find_option("verbose", "v", 0);
472 const char *zIgnoreFlag = find_option("ignore", 0, 1);
473 unsigned scanFlags = 0;
474 unsigned flags = 0;
@@ -528,11 +528,11 @@
528
529 /* We should be done with options. */
530 verify_all_options();
531
532 /* Check for changed files. */
533 vfile_check_signature(vid, useSha1sum ? CKSIG_SHA1 : 0);
534
535 /* Search for unmanaged files if requested. */
536 if( flags & C_EXTRA ){
537 Glob *pIgnore = glob_create(zIgnoreFlag);
538 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
@@ -1985,12 +1985,12 @@
1985 ** The --private option creates a private check-in that is never synced.
1986 ** Children of private check-ins are automatically private.
1987 **
1988 ** The --tag option applies the symbolic tag name to the check-in.
1989 **
1990 ** The --sha1sum option detects edited files by computing each file's
1991 ** SHA1 hash rather than just checking for changes to its size or mtime.
1992 **
1993 ** Options:
1994 ** --allow-conflict allow unresolved merge conflicts
1995 ** --allow-empty allow a commit with no changes
1996 ** --allow-fork allow the commit to fork
@@ -2010,11 +2010,11 @@
2010 ** input and assumes an answer of 'No' for every
2011 ** question.
2012 ** --no-warnings omit all warnings about file contents
2013 ** --nosign do not attempt to sign this commit with gpg
2014 ** --private do not sync changes and their descendants
2015 ** --sha1sum verify file status using SHA1 hashing rather
2016 ** than relying on file mtimes
2017 ** --tag TAG-NAME assign given tag TAG-NAME to the check-in
2018 ** --date-override DATETIME DATE to use instead of 'now'
2019 ** --user-override USER USER to use instead of the current default
2020 **
@@ -2033,11 +2033,11 @@
2033 int nvid; /* Blob-id of the new check-in */
2034 Blob comment; /* Check-in comment */
2035 const char *zComment; /* Check-in comment */
2036 Stmt q; /* Various queries */
2037 char *zUuid; /* UUID of the new check-in */
2038 int useSha1sum = 0; /* True to verify file status using SHA1 hashing */
2039 int noSign = 0; /* True to omit signing the manifest using GPG */
2040 int isAMerge = 0; /* True if checking in a merge */
2041 int noWarningFlag = 0; /* True if skipping all warnings */
2042 int noPrompt = 0; /* True if skipping all prompts */
2043 int forceFlag = 0; /* Undocumented: Disables all checks */
@@ -2068,11 +2068,11 @@
2068 Blob ans;
2069 char cReply;
2070
2071 memset(&sCiInfo, 0, sizeof(sCiInfo));
2072 url_proxy_options();
2073 useSha1sum = find_option("sha1sum", 0, 0)!=0;
2074 noSign = find_option("nosign",0,0)!=0;
2075 forceDelta = find_option("delta",0,0)!=0;
2076 forceBaseline = find_option("baseline",0,0)!=0;
2077 if( forceDelta && forceBaseline ){
2078 fossil_fatal("cannot use --delta and --baseline together");
@@ -2232,11 +2232,11 @@
2232 */
2233 if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){
2234 fossil_fatal("no such user: %s", g.zLogin);
2235 }
2236
2237 hasChanges = unsaved_changes(useSha1sum ? CKSIG_SHA1 : 0);
2238 db_begin_transaction();
2239 db_record_repository_filename(0);
2240 if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){
2241 fossil_fatal("nothing has changed; use --allow-empty to override");
2242 }
2243
--- src/checkin.c
+++ src/checkin.c
@@ -412,11 +412,11 @@
412 **
413 ** General options:
414 ** --abs-paths Display absolute pathnames.
415 ** --rel-paths Display pathnames relative to the current working
416 ** directory.
417 ** --hash Verify file status using hashing rather than
418 ** relying on file mtimes.
419 ** --case-sensitive <BOOL> Override case-sensitive setting.
420 ** --dotfiles Include unmanaged files beginning with a dot.
421 ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422 ** --no-dir-symlinks Disables support for directory symlinks.
@@ -464,11 +464,11 @@
464 {"no-merge", C_MERGE }, {"no-classify", C_CLASSIFY },
465 };
466
467 Blob report = BLOB_INITIALIZER;
468 enum {CHANGES, STATUS} command = *g.argv[1]=='s' ? STATUS : CHANGES;
469 int useHash = find_option("hash", 0, 0)!=0;
470 int showHdr = command==CHANGES && find_option("header", 0, 0);
471 int verboseFlag = command==CHANGES && find_option("verbose", "v", 0);
472 const char *zIgnoreFlag = find_option("ignore", 0, 1);
473 unsigned scanFlags = 0;
474 unsigned flags = 0;
@@ -528,11 +528,11 @@
528
529 /* We should be done with options. */
530 verify_all_options();
531
532 /* Check for changed files. */
533 vfile_check_signature(vid, useHash ? CKSIG_HASH : 0);
534
535 /* Search for unmanaged files if requested. */
536 if( flags & C_EXTRA ){
537 Glob *pIgnore = glob_create(zIgnoreFlag);
538 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
@@ -1985,12 +1985,12 @@
1985 ** The --private option creates a private check-in that is never synced.
1986 ** Children of private check-ins are automatically private.
1987 **
1988 ** The --tag option applies the symbolic tag name to the check-in.
1989 **
1990 ** The --hash option detects edited files by computing each file's
1991 ** artifact hash rather than just checking for changes to its size or mtime.
1992 **
1993 ** Options:
1994 ** --allow-conflict allow unresolved merge conflicts
1995 ** --allow-empty allow a commit with no changes
1996 ** --allow-fork allow the commit to fork
@@ -2010,11 +2010,11 @@
2010 ** input and assumes an answer of 'No' for every
2011 ** question.
2012 ** --no-warnings omit all warnings about file contents
2013 ** --nosign do not attempt to sign this commit with gpg
2014 ** --private do not sync changes and their descendants
2015 ** --hash verify file status using hashing rather
2016 ** than relying on file mtimes
2017 ** --tag TAG-NAME assign given tag TAG-NAME to the check-in
2018 ** --date-override DATETIME DATE to use instead of 'now'
2019 ** --user-override USER USER to use instead of the current default
2020 **
@@ -2033,11 +2033,11 @@
2033 int nvid; /* Blob-id of the new check-in */
2034 Blob comment; /* Check-in comment */
2035 const char *zComment; /* Check-in comment */
2036 Stmt q; /* Various queries */
2037 char *zUuid; /* UUID of the new check-in */
2038 int useHash = 0; /* True to verify file status using SHA1 hashing */
2039 int noSign = 0; /* True to omit signing the manifest using GPG */
2040 int isAMerge = 0; /* True if checking in a merge */
2041 int noWarningFlag = 0; /* True if skipping all warnings */
2042 int noPrompt = 0; /* True if skipping all prompts */
2043 int forceFlag = 0; /* Undocumented: Disables all checks */
@@ -2068,11 +2068,11 @@
2068 Blob ans;
2069 char cReply;
2070
2071 memset(&sCiInfo, 0, sizeof(sCiInfo));
2072 url_proxy_options();
2073 useHash = find_option("hash", 0, 0)!=0;
2074 noSign = find_option("nosign",0,0)!=0;
2075 forceDelta = find_option("delta",0,0)!=0;
2076 forceBaseline = find_option("baseline",0,0)!=0;
2077 if( forceDelta && forceBaseline ){
2078 fossil_fatal("cannot use --delta and --baseline together");
@@ -2232,11 +2232,11 @@
2232 */
2233 if( !db_exists("SELECT 1 FROM user WHERE login=%Q", g.zLogin) ){
2234 fossil_fatal("no such user: %s", g.zLogin);
2235 }
2236
2237 hasChanges = unsaved_changes(useHash ? CKSIG_HASH : 0);
2238 db_begin_transaction();
2239 db_record_repository_filename(0);
2240 if( hasChanges==0 && !isAMerge && !allowEmpty && !forceFlag ){
2241 fossil_fatal("nothing has changed; use --allow-empty to override");
2242 }
2243
+2 -2
--- src/vfile.c
+++ src/vfile.c
@@ -130,11 +130,11 @@
130130
/*
131131
** The cksigFlags parameter to vfile_check_signature() is an OR-ed
132132
** combination of the following bits:
133133
*/
134134
#define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */
135
-#define CKSIG_SHA1 0x002 /* Verify file content using sha1sum */
135
+#define CKSIG_HASH 0x002 /* Verify file content using hashing */
136136
#define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137137
138138
#endif /* INTERFACE */
139139
140140
/*
@@ -172,11 +172,11 @@
172172
*/
173173
void vfile_check_signature(int vid, unsigned int cksigFlags){
174174
int nErr = 0;
175175
Stmt q;
176176
Blob fileCksum, origCksum;
177
- int useMtime = (cksigFlags & CKSIG_SHA1)==0
177
+ int useMtime = (cksigFlags & CKSIG_HASH)==0
178178
&& db_get_boolean("mtime-changes", 1);
179179
180180
db_begin_transaction();
181181
db_prepare(&q, "SELECT id, %Q || pathname,"
182182
" vfile.mrid, deleted, chnged, uuid, size, mtime,"
183183
--- src/vfile.c
+++ src/vfile.c
@@ -130,11 +130,11 @@
130 /*
131 ** The cksigFlags parameter to vfile_check_signature() is an OR-ed
132 ** combination of the following bits:
133 */
134 #define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */
135 #define CKSIG_SHA1 0x002 /* Verify file content using sha1sum */
136 #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137
138 #endif /* INTERFACE */
139
140 /*
@@ -172,11 +172,11 @@
172 */
173 void vfile_check_signature(int vid, unsigned int cksigFlags){
174 int nErr = 0;
175 Stmt q;
176 Blob fileCksum, origCksum;
177 int useMtime = (cksigFlags & CKSIG_SHA1)==0
178 && db_get_boolean("mtime-changes", 1);
179
180 db_begin_transaction();
181 db_prepare(&q, "SELECT id, %Q || pathname,"
182 " vfile.mrid, deleted, chnged, uuid, size, mtime,"
183
--- src/vfile.c
+++ src/vfile.c
@@ -130,11 +130,11 @@
130 /*
131 ** The cksigFlags parameter to vfile_check_signature() is an OR-ed
132 ** combination of the following bits:
133 */
134 #define CKSIG_ENOTFILE 0x001 /* non-file FS objects throw an error */
135 #define CKSIG_HASH 0x002 /* Verify file content using hashing */
136 #define CKSIG_SETMTIME 0x004 /* Set mtime to last check-out time */
137
138 #endif /* INTERFACE */
139
140 /*
@@ -172,11 +172,11 @@
172 */
173 void vfile_check_signature(int vid, unsigned int cksigFlags){
174 int nErr = 0;
175 Stmt q;
176 Blob fileCksum, origCksum;
177 int useMtime = (cksigFlags & CKSIG_HASH)==0
178 && db_get_boolean("mtime-changes", 1);
179
180 db_begin_transaction();
181 db_prepare(&q, "SELECT id, %Q || pathname,"
182 " vfile.mrid, deleted, chnged, uuid, size, mtime,"
183

Keyboard Shortcuts

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