DELETED .fossil-settings/clean-glob Index: .fossil-settings/clean-glob ================================================================== --- .fossil-settings/clean-glob +++ /dev/null @@ -1,19 +0,0 @@ -*.a -*.lib -*.manifest -*.o -*.obj -*.pdb -*.res -Makefile -autosetup/jimsh0 -autosetup/jimsh0.exe -bld/* -wbld/* -win/*.c -win/*.h -win/*.exe -win/headers -win/linkopts -autoconfig.h -config.log Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -1,5 +1,22 @@ +*.a +*.lib +*.manifest +*.o +*.obj +*.pdb +*.res +Makefile +bld/* +wbld/* +win/*.c +win/*.h +win/*.exe +win/headers +win/linkopts +autoconfig.h +config.log compat/openssl* compat/tcl* fossil fossil.exe win/fossil.exe Index: src/add.c ================================================================== --- src/add.c +++ src/add.c @@ -253,15 +253,14 @@ ** ** When adding files or directories recursively, filenames that begin ** with "." are excluded by default. To include such files, add ** the "--dotfiles" option to the command-line. ** -** The --ignore and --clean options are comma-separate lists of glob patterns +** The --ignore option is a comma-separate lists of glob patterns ** for files to be excluded. Example: '*.o,*.obj,*.exe' If the --ignore ** option does not appear on the command line then the "ignore-glob" setting -** is used. If the --clean option does not appear on the command line then -** the "clean-glob" setting is used. +** is used. ** ** If files are attempted to be added explicitly on the command line which ** match "ignore-glob", a confirmation is asked first. This can be prevented ** using the -f|--force option. ** @@ -274,46 +273,38 @@ ** --case-sensitive Override the case-sensitive setting. ** --dotfiles include files beginning with a dot (".") ** -f|--force Add files without prompting ** --ignore Ignore unmanaged files matching patterns from ** the comma separated list of glob patterns. -** --clean Also ignore files matching patterns from -** the comma separated list of glob patterns. ** ** See also: addremove, rm */ void add_cmd(void){ int i; /* Loop counter */ int vid; /* Currently checked out version */ int nRoot; /* Full path characters in g.zLocalRoot */ - const char *zCleanFlag; /* The --clean option or clean-glob setting */ const char *zIgnoreFlag; /* The --ignore option or ignore-glob setting */ - Glob *pIgnore, *pClean; /* Ignore everything matching the glob patterns */ + Glob *pIgnore; /* Ignore everything matching the glob patterns */ unsigned scanFlags = 0; /* Flags passed to vfile_scan() */ int forceFlag; - zCleanFlag = find_option("clean",0,1); zIgnoreFlag = find_option("ignore",0,1); forceFlag = find_option("force","f",0)!=0; if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL; /* We should be done with options.. */ verify_all_options(); db_must_be_within_tree(); - if( zCleanFlag==0 ){ - zCleanFlag = db_get("clean-glob", 0); - } if( zIgnoreFlag==0 ){ zIgnoreFlag = db_get("ignore-glob", 0); } if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; vid = db_lget_int("checkout",0); db_begin_transaction(); db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", filename_collation()); - pClean = glob_create(zCleanFlag); pIgnore = glob_create(zIgnoreFlag); nRoot = strlen(g.zLocalRoot); /* Load the names of all files that are to be added into sfile temp table */ for(i=2; i Override the case-sensitive setting. ** --dotfiles Include files beginning with a dot (".") ** --ignore Ignore unmanaged files matching patterns from ** the comma separated list of glob patterns. -** --clean Also ignore files matching patterns from -** the comma separated list of glob patterns. ** -n|--dry-run If given, display instead of run actions. ** ** See also: add, rm */ void addremove_cmd(void){ Blob path; - const char *zCleanFlag = find_option("clean",0,1); const char *zIgnoreFlag = find_option("ignore",0,1); unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0; int dryRunFlag = find_option("dry-run","n",0)!=0; int n; Stmt q; int vid; int nAdd = 0; int nDelete = 0; - Glob *pIgnore, *pClean; + Glob *pIgnore; if( !dryRunFlag ){ dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ } @@ -654,13 +640,10 @@ fossil_fatal( "%s: Can only work on the entire checkout, no arguments supported.", g.argv[1]); } db_must_be_within_tree(); - if( zCleanFlag==0 ){ - zCleanFlag = db_get("clean-glob", 0); - } if( zIgnoreFlag==0 ){ zIgnoreFlag = db_get("ignore-glob", 0); } if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; vid = db_lget_int("checkout",0); @@ -675,15 +658,13 @@ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s)", filename_collation()); n = strlen(g.zLocalRoot); blob_init(&path, g.zLocalRoot, n-1); /* now we read the complete file structure into a temp table */ - pClean = glob_create(zCleanFlag); pIgnore = glob_create(zIgnoreFlag); - vfile_scan(&path, blob_size(&path), scanFlags, pClean, pIgnore); + vfile_scan(&path, blob_size(&path), scanFlags, pIgnore); glob_free(pIgnore); - glob_free(pClean); nAdd = add_files_in_sfile(vid); /* step 2: search for missing files */ db_prepare(&q, "SELECT pathname, %Q || pathname, deleted FROM vfile" Index: src/checkin.c ================================================================== --- src/checkin.c +++ src/checkin.c @@ -80,19 +80,19 @@ db_multi_exec("CREATE TEMP TABLE sfile(pathname TEXT PRIMARY KEY %s," " mtime INTEGER, size INTEGER)", filename_collation()); nRoot = (int)strlen(g.zLocalRoot); if( argc==0 ){ blob_init(&name, g.zLocalRoot, nRoot - 1); - vfile_scan(&name, blob_size(&name), scanFlags, pIgnore, 0); + vfile_scan(&name, blob_size(&name), scanFlags, pIgnore); blob_reset(&name); }else{ for(i=0; i WARNING: Never prompt to delete any files matching -** this comma separated list of glob patterns. Also, -** deletions of any files matching this pattern list -** cannot be undone. ** --ignore Ignore files matching patterns from the ** comma separated list of glob patterns. ** --keep Keep files matching this comma separated ** list of glob patterns. ** -n|--dry-run Delete nothing, but display what would have been @@ -961,12 +953,12 @@ int emptyDirsFlag, dirsOnlyFlag; int disableUndo, noPrompt; int alwaysPrompt = 0; unsigned scanFlags = 0; int verilyFlag = 0; - const char *zIgnoreFlag, *zKeepFlag, *zCleanFlag; - Glob *pIgnore, *pKeep, *pClean; + const char *zIgnoreFlag, *zKeepFlag; + Glob *pIgnore, *pKeep; int nRoot; #ifndef UNDO_SIZE_LIMIT /* TODO: Setting? */ #define UNDO_SIZE_LIMIT (10*1024*1024) /* 10MiB */ #endif @@ -989,41 +981,36 @@ if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP; if( find_option("allckouts",0,0)!=0 ) scanFlags |= SCAN_NESTED; zIgnoreFlag = find_option("ignore",0,1); verboseFlag = find_option("verbose","v",0)!=0; zKeepFlag = find_option("keep",0,1); - zCleanFlag = find_option("clean",0,1); db_must_be_within_tree(); if( find_option("verily","x",0)!=0 ){ - verilyFlag = allFileFlag = allDirFlag = 1; + verilyFlag = 1; emptyDirsFlag = 1; - disableUndo = 1; + allDirFlag = 1; scanFlags |= SCAN_ALL; - zCleanFlag = 0; } - if( zIgnoreFlag==0 && !verilyFlag ){ + if( zIgnoreFlag==0 ){ zIgnoreFlag = db_get("ignore-glob", 0); } if( zKeepFlag==0 && !verilyFlag ){ zKeepFlag = db_get("keep-glob", 0); } - if( zCleanFlag==0 && !verilyFlag ){ - zCleanFlag = db_get("clean-glob", 0); - } if( db_get_boolean("dotfiles", 0) ) scanFlags |= SCAN_ALL; verify_all_options(); pIgnore = glob_create(zIgnoreFlag); pKeep = glob_create(zKeepFlag); - pClean = glob_create(zCleanFlag); nRoot = (int)strlen(g.zLocalRoot); /* Always consider symlinks. */ g.allowSymlinks = db_allow_symlinks_by_default(); if( !dirsOnlyFlag ){ Stmt q; Blob repo; if( !dryRunFlag && !disableUndo ) undo_begin(); - locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); + locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, + verilyFlag ? 0 : pIgnore); db_prepare(&q, "SELECT %Q || pathname FROM sfile" " WHERE pathname NOT IN (%s)" " ORDER BY 1", g.zLocalRoot, fossil_all_reserved_names(0) @@ -1040,11 +1027,12 @@ fossil_print("KEPT file \"%s\" not removed (due to --keep" " or \"keep-glob\")\n", zName+nRoot); } continue; } - if( !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ + if( !dryRunFlag + && !(verilyFlag && glob_match(pIgnore, zName+nRoot)) ){ char *zPrompt = 0; char cReply; Blob ans = empty_blob; int undoRc = UNDO_NONE; if( alwaysPrompt ){ @@ -1102,12 +1090,12 @@ if( emptyDirsFlag ){ Glob *pEmptyDirs = glob_create(db_get("empty-dirs", 0)); Stmt q; Blob root; blob_init(&root, g.zLocalRoot, nRoot - 1); - vfile_dir_scan(&root, blob_size(&root), scanFlags, pIgnore, - pEmptyDirs); + vfile_dir_scan(&root, blob_size(&root), scanFlags, + verilyFlag ? 0 : pIgnore, pEmptyDirs); blob_reset(&root); db_prepare(&q, "SELECT %Q || x FROM dscan_temp" " WHERE x NOT IN (%s) AND y = 0" " ORDER BY 1 DESC", @@ -1120,11 +1108,12 @@ fossil_print("KEPT directory \"%s\" not removed (due to --keep" " or \"keep-glob\")\n", zName+nRoot); } continue; } - if( !allDirFlag && !dryRunFlag && !glob_match(pClean, zName+nRoot) ){ + if( !allDirFlag && !dryRunFlag + && !(verilyFlag && glob_match(pIgnore, zName+nRoot)) ){ char cReply; if( !noPrompt ){ Blob ans; char *prompt = mprintf("Remove empty directory \"%s\" (a=all/y/N)? ", zName+nRoot); @@ -1150,11 +1139,10 @@ } } db_finalize(&q); glob_free(pEmptyDirs); } - glob_free(pClean); glob_free(pKeep); glob_free(pIgnore); } /* Index: src/configure.c ================================================================== --- src/configure.c +++ src/configure.c @@ -118,11 +118,10 @@ { "short-project-name", CONFIGSET_PROJ }, { "project-description", CONFIGSET_PROJ }, { "index-page", CONFIGSET_PROJ }, { "manifest", CONFIGSET_PROJ }, { "binary-glob", CONFIGSET_PROJ }, - { "clean-glob", CONFIGSET_PROJ }, { "ignore-glob", CONFIGSET_PROJ }, { "keep-glob", CONFIGSET_PROJ }, { "crlf-glob", CONFIGSET_PROJ }, { "crnl-glob", CONFIGSET_PROJ }, { "encoding-glob", CONFIGSET_PROJ }, Index: src/db.c ================================================================== --- src/db.c +++ src/db.c @@ -2778,11 +2778,10 @@ defined(__APPLE__) { "case-sensitive", 0, 0, 0, 0, "off" }, #else { "case-sensitive", 0, 0, 0, 0, "on" }, #endif - { "clean-glob", 0, 40, 1, 0, "" }, { "clearsign", 0, 0, 0, 0, "off" }, { "crlf-glob", 0, 40, 1, 0, "" }, { "crnl-glob", 0, 40, 1, 0, "" }, { "default-perms", 0, 16, 0, 0, "u" }, { "diff-binary", 0, 0, 0, 0, "on" }, @@ -2929,15 +2928,10 @@ ** case-sensitive If TRUE, the files whose names differ only in case ** are considered distinct. If FALSE files whose names ** differ only in case are the same file. Defaults to ** TRUE for unix and FALSE for Cygwin, Mac and Windows. ** -** clean-glob The VALUE is a comma or newline-separated list of GLOB -** (versionable) patterns specifying files that the "clean" command will -** delete without prompting or allowing undo. -** Example: *.a,*.lib,*.o -** ** clearsign When enabled, fossil will attempt to sign all commits ** with gpg. When disabled (the default), commits will ** be unsigned. Default: off ** ** crlf-glob A comma or newline-separated list of GLOB patterns for Index: src/json_config.c ================================================================== --- src/json_config.c +++ src/json_config.c @@ -74,11 +74,10 @@ { "short-project-name", CONFIGSET_PROJ }, { "project-description", CONFIGSET_PROJ }, { "index-page", CONFIGSET_PROJ }, { "manifest", CONFIGSET_PROJ }, { "binary-glob", CONFIGSET_PROJ }, -{ "clean-glob", CONFIGSET_PROJ }, { "ignore-glob", CONFIGSET_PROJ }, { "keep-glob", CONFIGSET_PROJ }, { "crlf-glob", CONFIGSET_PROJ }, { "crnl-glob", CONFIGSET_PROJ }, { "encoding-glob", CONFIGSET_PROJ }, Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -1263,11 +1263,11 @@ */ blob_init(&base, g.zRepositoryName, -1); sqlite3_open(":memory:", &g.db); db_multi_exec("CREATE TABLE sfile(pathname TEXT);"); db_multi_exec("CREATE TABLE vfile(pathname);"); - vfile_scan(&base, blob_size(&base), 0, 0, 0); + vfile_scan(&base, blob_size(&base), 0, 0); db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB '*[^/].fossil'"); allRepo = 0; } @ @ Index: src/vfile.c ================================================================== --- src/vfile.c +++ src/vfile.c @@ -469,12 +469,11 @@ */ void vfile_scan( Blob *pPath, /* Directory to be scanned */ int nPrefix, /* Number of bytes in directory name */ unsigned scanFlags, /* Zero or more SCAN_xxx flags */ - Glob *pIgnore1, /* Do not add files that match this GLOB */ - Glob *pIgnore2 /* Omit files matching this GLOB too */ + Glob *pIgnore /* Do not add files that match this GLOB */ ){ DIR *d; int origSize; struct dirent *pEntry; int skipAll = 0; @@ -481,14 +480,13 @@ static Stmt ins; static int depth = 0; void *zNative; origSize = blob_size(pPath); - if( pIgnore1 || pIgnore2 ){ + if( pIgnore ){ blob_appendf(pPath, "/"); - if( glob_match(pIgnore1, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; - if( glob_match(pIgnore2, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; + if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; blob_resize(pPath, origSize); } if( skipAll ) return; if( depth==0 ){ @@ -517,21 +515,20 @@ if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; } zUtf8 = fossil_path_to_utf8(pEntry->d_name); blob_appendf(pPath, "/%s", zUtf8); zPath = blob_str(pPath); - if( glob_match(pIgnore1, &zPath[nPrefix+1]) || - glob_match(pIgnore2, &zPath[nPrefix+1]) ){ + if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ /* do nothing */ #ifdef _DIRENT_HAVE_D_TYPE }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) ? (file_wd_isdir(zPath)==1) : (pEntry->d_type==DT_DIR) ){ #else }else if( file_wd_isdir(zPath)==1 ){ #endif if( !vfile_top_of_checkout(zPath) ){ - vfile_scan(pPath, nPrefix, scanFlags, pIgnore1, pIgnore2); + vfile_scan(pPath, nPrefix, scanFlags, pIgnore); } #ifdef _DIRENT_HAVE_D_TYPE }else if( (pEntry->d_type==DT_UNKNOWN || pEntry->d_type==DT_LNK) ? (file_wd_isfile_or_link(zPath)) : (pEntry->d_type==DT_REG) ){ #else Index: test/tester.tcl ================================================================== --- test/tester.tcl +++ test/tester.tcl @@ -223,11 +223,10 @@ # this list (and procedure) most likely needs to be modified as well. # set result [list \ allow-symlinks \ binary-glob \ - clean-glob \ crlf-glob \ crnl-glob \ dotfiles \ empty-dirs \ encoding-glob \ @@ -262,11 +261,10 @@ auto-shun \ autosync \ autosync-tries \ binary-glob \ case-sensitive \ - clean-glob \ clearsign \ crlf-glob \ crnl-glob \ default-perms \ diff-binary \ Index: www/sync.wiki ================================================================== --- www/sync.wiki +++ www/sync.wiki @@ -526,13 +526,12 @@
  • short-project-name
  • project-description
  • index-page
  • manifest
  • binary-glob -
  • clean-glob -
      • ignore-glob +
          • keep-glob
          • crlf-glob
          • crnl-glob
          • encoding-glob
          • empty-dirs