('>':v) -> checkcmp (>) (>) v
_ -> checkglob ""
checkglob v =
- let cglob = compileGlob v CaseInsensative (GlobFilePath False)
+ let cglob = compileGlob v CaseInsensitive (GlobFilePath False)
in matchGlob cglob . decodeBS . fromMetaValue
checkcmp cmp cmp' v mv' =
let v' = decodeBS (fromMetaValue mv')
combineViewFilter (FilterValues _) newglob@(FilterGlob _) =
(newglob, Widening)
combineViewFilter (FilterGlob oldglob) new@(FilterValues s)
- | all (matchGlob (compileGlob oldglob CaseInsensative (GlobFilePath False)) . decodeBS . fromMetaValue) (S.toList s) = (new, Narrowing)
+ | all (matchGlob (compileGlob oldglob CaseInsensitive (GlobFilePath False)) . decodeBS . fromMetaValue) (S.toList s) = (new, Narrowing)
| otherwise = (new, Widening)
{- With two globs, the old one is discarded, and the new one is used.
- We can tell if that's a narrowing change by checking if the old
- widening. -}
combineViewFilter (FilterGlob old) newglob@(FilterGlob new)
| old == new = (newglob, Unchanged)
- | matchGlob (compileGlob old CaseInsensative (GlobFilePath False)) new = (newglob, Narrowing)
+ | matchGlob (compileGlob old CaseInsensitive (GlobFilePath False)) new = (newglob, Narrowing)
| otherwise = (newglob, Widening)
{- Combining FilterValuesOrUnset and FilterGlobOrUnset with FilterValues
- and FilterGlob maintains the OrUnset if the second parameter has it,
in (new, viewchange)
combineViewFilter (FilterGlobOrUnset old _) newglob@(FilterGlobOrUnset new _)
| old == new = (newglob, Unchanged)
- | matchGlob (compileGlob old CaseInsensative (GlobFilePath False)) new = (newglob, Narrowing)
+ | matchGlob (compileGlob old CaseInsensitive (GlobFilePath False)) new = (newglob, Narrowing)
| otherwise = (newglob, Widening)
combineViewFilter (FilterGlob _) newglob@(FilterGlobOrUnset _ _) =
(newglob, Widening)
matcher matchunset (FilterValues s) =
\values -> setmatches matchunset $ S.intersection s values
matcher matchunset (FilterGlob glob) =
- let cglob = compileGlob glob CaseInsensative (GlobFilePath False)
+ let cglob = compileGlob glob CaseInsensitive (GlobFilePath False)
in \values -> setmatches matchunset $
S.filter (matchGlob cglob . decodeBS . fromMetaValue) values
matcher _ (ExcludeValues excludes) =
* metadata: Field names limited to alphanumerics and a few whitelisted
punctuation characters to avoid issues with views, etc.
- * metadata: Field names are now case insensative.
+ * metadata: Field names are now case insensitive.
* When constructing views, metadata is available about the location of the
file in the view's reference branch. Allows incorporating parts of the
directory hierarchy in a view.
For example `git annex view tag=* podcasts/=*` makes a view in the form
tag/showname.
* --metadata field=value can now use globs to match, and matches
- case insensatively, the same as git annex view field=value does.
+ case insensitively, the same as git annex view field=value does.
* annex.genmetadata can be set to make git-annex automatically set
metadata (year and month) when adding files.
* Make annex.web-options be used in several places that call curl.
matchGlobFile :: String -> MatchInfo -> Annex Bool
matchGlobFile glob = go
where
- cglob = compileGlob glob CaseSensative (GlobFilePath True) -- memoized
+ cglob = compileGlob glob CaseSensitive (GlobFilePath True) -- memoized
go (MatchingFile fi) = pure $ matchGlob cglob (fromRawFilePath (matchFile fi))
go (MatchingInfo p) = pure $ case providedFilePath p of
Just f -> matchGlob cglob (fromRawFilePath f)
check k . toRawFilePath
=<< getUserInfo (userProvidedFilePath p)
- cglob = compileGlob glob CaseSensative (GlobFilePath True) -- memoized
+ cglob = compileGlob glob CaseSensitive (GlobFilePath True) -- memoized
matchesglob f = matchGlob cglob (fromRawFilePath f)
#ifdef mingw32_HOST_OS
, matchNeedsLocationLog = False
}
where
- cglob = compileGlob glob CaseSensative (GlobFilePath False) -- memoized
+ cglob = compileGlob glob CaseSensitive (GlobFilePath False) -- memoized
go (MatchingFile fi) = catchBoolIO $
maybe False (matchGlob cglob)
<$> querymagic magic (fromRawFilePath (contentFile fi))
getglob f pc = do
glob <- getRemoteConfigValue f pc
- Just $ compileGlob glob CaseInsensative (GlobFilePath False)
+ Just $ compileGlob glob CaseInsensitive (GlobFilePath False)
mk minclude mexclude = pure $ UrlIncludeExclude
{ checkUrlIncludeExclude = \u -> and
| RemoveMatching Glob
allRefSpec :: RefSpec
-allRefSpec = [AddMatching $ compileGlob "*" CaseSensative (GlobFilePath False)]
+allRefSpec = [AddMatching $ compileGlob "*" CaseSensitive (GlobFilePath False)]
parseRefSpec :: String -> Either String RefSpec
parseRefSpec v = case partitionEithers (map mk $ splitc ':' v) of
where
mk ('+':s)
| any (`elem` s) "*?" =
- Right $ AddMatching $ compileGlob s CaseSensative (GlobFilePath False)
+ Right $ AddMatching $ compileGlob s CaseSensitive (GlobFilePath False)
| otherwise = Right $ AddRef $ Ref $ encodeBS s
- mk ('-':s) = Right $ RemoveMatching $ compileGlob s CaseSensative (GlobFilePath False)
+ mk ('-':s) = Right $ RemoveMatching $ compileGlob s CaseSensitive (GlobFilePath False)
mk "reflog" = Right AddRefLog
mk s = Left $ "bad refspec item \"" ++ s ++ "\" (expected + or - prefix)"
newtype Glob = Glob Regex
-data GlobCase = CaseSensative | CaseInsensative
+data GlobCase = CaseSensitive | CaseInsensitive
-- Is the glob being used to match filenames?
--
where
regex = '^' : wildToRegex globfilepath glob ++ "$"
casesentitive = case globcase of
- CaseSensative -> True
- CaseInsensative -> False
+ CaseSensitive -> True
+ CaseInsensitive -> False
wildToRegex :: GlobFilePath -> String -> String
wildToRegex (GlobFilePath globfile) = concat . go
hash directories today, by setting `git config annex.tune.objecthashlower true`
before you run `git annex init` for the first time.
-If you know you will need to move a repository between case-insensative and
-case-sensative filesystems, you could use that configuration. But that
+If you know you will need to move a repository between case-insensitive and
+case-sensitive filesystems, you could use that configuration. But that
would be very forward looking, and instead users are just going to stumble
over the mixed case directories from time to time.
git-annex checks both locations (eg, a bare repo defaults to xxx/yyy
but really old ones might use xX/yY for some keys).
- The mixed case hash directories have caused trouble on case-insensative
+ The mixed case hash directories have caused trouble on case-insensitive
filesystems, although that has mostly been papered over to avoid
problems. One remaining problem users can stuble on occurs
when [[moving a repository from OSX to Linux|bugs/OSX_case_insensitive_filesystem]].