Added --no-check-gitignore option for finer grained control than using --force.

add, addurl, importfeed, import: Added --no-check-gitignore option
for finer grained control than using --force.

(--force is used for too many different things, and at least one
of these also uses it for something else. I would like to reduce
--force's footprint until it only forces drops or a few other data
losses. For now, --force still disables checking ignores too.)

addunused: Don't check .gitignores when adding files. This is a behavior
change, but I justify it by analogy with git add of a gitignored file
adding it, asking to add all unused files back should add them all back,
not skip some. The old behavior was surprising.

In Command.Lock and Command.ReKey, CheckGitIgnore False does not change
behavior, it only makes explicit what is done. Since these commands are run
on annexed files, the file is already checked into git, so git add won't
check ignores.
This commit is contained in:
Joey Hess 2020-09-18 13:12:04 -04:00
parent 500454935f
commit d0b06c17c0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
15 changed files with 140 additions and 89 deletions

View file

@ -124,7 +124,7 @@ cleanup file oldkey newkey = do
( do
-- Update symlink to use the new key.
liftIO $ removeFile (fromRawFilePath file)
addLink (fromRawFilePath file) newkey Nothing
addLink (CheckGitIgnore False) (fromRawFilePath file) newkey Nothing
, do
mode <- liftIO $ catchMaybeIO $ fileMode <$> R.getFileStatus file
liftIO $ whenM (isJust <$> isPointerFile file) $