diff --git a/Command/AddComputed.hs b/Command/AddComputed.hs index 4edce492e2..0d614a1fc0 100644 --- a/Command/AddComputed.hs +++ b/Command/AddComputed.hs @@ -37,14 +37,14 @@ cmd = notBareRepo $ data AddComputedOptions = AddComputedOptions { computeParams :: CmdParams , computeRemote :: DeferredParse Remote - , reproducible :: Reproducible + , reproducible :: Maybe Reproducible } optParser :: CmdParamsDesc -> Parser AddComputedOptions optParser desc = AddComputedOptions <$> cmdParams desc <*> (mkParseRemoteOption <$> parseToOption) - <*> (fromMaybe (Reproducible False) <$> parseReproducible) + <*> parseReproducible newtype Reproducible = Reproducible { isReproducible :: Bool } @@ -92,7 +92,7 @@ perform o r program = do , Remote.Compute.computeInputs = mempty , Remote.Compute.computeOutputs = mempty , Remote.Compute.computeSubdir = subdir - , Remote.Compute.computeReproducible = isreproducible + , Remote.Compute.computeReproducible = False } fast <- Annex.getRead Annex.fast starttime <- liftIO currentMonotonicTimestamp @@ -140,7 +140,7 @@ perform o r program = do | fast = do addSymlink outputfile stateurlk Nothing return stateurlk - | isreproducible = do + | isreproducible state = do sz <- liftIO $ getFileSize outputfile' metered Nothing sz Nothing $ \_ p -> ingestwith $ ingestAdd p (Just ld) @@ -170,4 +170,6 @@ perform o r program = do calcduration (MonotonicTimestamp starttime) (MonotonicTimestamp endtime) = fromIntegral (endtime - starttime) :: NominalDiffTime - isreproducible = isReproducible (reproducible o) + isreproducible state = case reproducible o of + Just v -> isReproducible v + Nothing -> Remote.Compute.computeReproducible state diff --git a/doc/git-annex-addcomputed.mdwn b/doc/git-annex-addcomputed.mdwn index 9f096770b7..1da287f0cf 100644 --- a/doc/git-annex-addcomputed.mdwn +++ b/doc/git-annex-addcomputed.mdwn @@ -53,8 +53,11 @@ Some examples of how this might look: * `--fast` - Adds computed files to the repository, without generating their content - yet. + Adds computed files to the repository, without doing any work yet to + compute their content. + + This implies `--unreproducible`, because even if the compute remote + produces reproducible output, it's not available. * `--unreproducible`, `-u` @@ -70,7 +73,7 @@ Some examples of how this might look: Indicate that the computation is expected to be fully reproducible. This is the default when the compute remote indicates that it produces - reproducible output. + reproducible output (except when using `--fast`). If a computation turns out not to be fully reproducible, then getting the file from the compute remote will later fail with a checksum