git-annex/CmdLine
Joey Hess d266a41f8d
prevent numcopies or mincopies being configured to 0
Ignore annex.numcopies set to 0 in gitattributes or git config, or by
git-annex numcopies or by --numcopies, since that configuration would make
git-annex easily lose data. Same for mincopies.

This is a continuation of the work to make data only be able to be lost
when --force is used. It earlier led to the --trust option being disabled,
and similar reasoning applies here.

Most numcopies configs had docs that strongly discouraged setting it to 0
anyway. And I can't imagine a use case for setting to 0. Not that there
might not be one, but it's just so far from the intended use case of
git-annex, of managing and storing your data, that it does not seem like
it makes sense to cater to such a hypothetical use case, where any
git-annex drop can lose your data at any time.

Using a smart constructor makes sure every place avoids 0. Note that this
does mean that NumCopies is for the configured desired values, and not the
actual existing number of copies, which of course can be 0. The name
configuredNumCopies is used to make that clear.

Sponsored-by: Brock Spratlen on Patreon
2022-03-28 15:20:34 -04:00
..
GitAnnex prevent numcopies or mincopies being configured to 0 2022-03-28 15:20:34 -04:00
GitAnnexShell remove git-annex-shell compat code 2021-10-11 15:36:51 -04:00
Action.hs --size-limit exit 101 2021-06-04 16:43:47 -04:00
Batch.hs reject batch options combined with non-batch options 2022-01-26 13:00:19 -04:00
GitAnnex.hs add git-annex filter-process 2021-11-04 15:02:36 -04:00
GitAnnexShell.hs fix duplicated commands in git-annex-shell usage display 2021-10-11 15:42:27 -04:00
GitRemoteTorAnnex.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
GlobalSetter.hs implement fastDebug 2021-04-06 15:24:28 -04:00
Option.hs simplify and speed up Utility.FileSystemEncoding 2021-08-11 12:13:31 -04:00
Seek.hs fix annex.skipunknown false error propagation 2022-02-28 12:54:56 -04:00
Usage.hs improve synopsis 2020-12-17 12:51:49 -04:00