Overview
SHA1 Hash: | 6aff11f03f25f00b6ec3c3233fb6426fc2ae8b4a |
---|---|
Date: | 2007-08-03 23:30:52 |
User: | drh |
Comment: | Show an error if unrecognized command-line options appear on the commit command. Also add the (undocumented) "omit-ci-sig" configuration option on the database. Setting omit-ci-sig omits the PGP signature on check-in. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/checkin.c from [a1a87577e4] to [43e2abb7c2].
@@ -266,17 +266,20 @@ int vid, nrid, nvid; Blob comment; Stmt q; Stmt q2; char *zUuid, *zDate; + int noSign = 0; /* True to omit signing the manifest using GPG */ char *zManifestFile; /* Name of the manifest file */ Blob manifest; Blob mcksum; /* Self-checksum on the manifest */ Blob cksum1, cksum2; /* Before and after commit checksums */ Blob cksum1b; /* Checksum recorded in the manifest */ db_must_be_within_tree(); + noSign = db_get_int("omit-ci-sig", 0); + verify_all_options(); /* There are two ways this command may be executed. If there are ** no arguments following the word "commit", then all modified files ** in the checked out directory are committed. If one or more arguments ** follows "commit", then only those files are committed. @@ -377,11 +380,11 @@ blob_appendf(&manifest, "R %b\n", &cksum1); blob_appendf(&manifest, "U %F\n", g.zLogin); md5sum_blob(&manifest, &mcksum); blob_appendf(&manifest, "Z %b\n", &mcksum); zManifestFile = mprintf("%smanifest", g.zLocalRoot); - if( clearsign(&manifest, &manifest) ){ + if( !noSign && clearsign(&manifest, &manifest) ){ Blob ans; blob_zero(&ans); prompt_user("unable to sign manifest. continue [y/N]? ", &ans); if( blob_str(&ans)[0]!='y' ){ db_end_transaction(1);
Modified src/main.c from [efc0bca8ad] to [67d59cdc12].
@@ -296,10 +296,24 @@ remove_from_argv(i, 1+hasArg); break; } } return zReturn; +} + +/* +** Verify that there are no processed command-line options. If +** Any remaining command-line argument begins with "-" print +** an error message and quit. +*/ +void verify_all_options(void){ + int i; + for(i=1; i<g.argc; i++){ + if( g.argv[i][0]=='-' ){ + fossil_fatal("unrecognized command-line option: %s", g.argv[i]); + } + } } /* ** Print a list of words in multiple columns. */