From f0df6605706a196eead1782d577a5e8981da5fef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Aug 2014 14:38:53 -0400 Subject: [PATCH] WORM backend: When adding a file in a subdirectory, avoid including the subdirectory in the key name. --- Backend/WORM.hs | 2 +- debian/changelog | 2 ++ ...ys_differ_depending_on_working_dir_during_add.mdwn | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Backend/WORM.hs b/Backend/WORM.hs index c972602ad0..6ba5139606 100644 --- a/Backend/WORM.hs +++ b/Backend/WORM.hs @@ -36,7 +36,7 @@ backend = Backend keyValue :: KeySource -> Annex (Maybe Key) keyValue source = do stat <- liftIO $ getFileStatus $ contentLocation source - n <- genKeyName $ keyFilename source + n <- genKeyName $ takeFileName $ keyFilename source return $ Just $ stubKey { keyName = n , keyBackendName = name backend diff --git a/debian/changelog b/debian/changelog index 48b6296d76..722e9347e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,8 @@ git-annex (5.20140718) UNRELEASED; urgency=medium repositories, for safer detection of eg, renaming of files with the same size and mtime. * direct: Fix ugly warning messages. + * WORM backend: When adding a file in a subdirectory, avoid including the + subdirectory in the key name. -- Joey Hess Mon, 21 Jul 2014 14:41:26 -0400 diff --git a/doc/bugs/WORM_keys_differ_depending_on_working_dir_during_add.mdwn b/doc/bugs/WORM_keys_differ_depending_on_working_dir_during_add.mdwn index e412201141..9787ad5cc6 100644 --- a/doc/bugs/WORM_keys_differ_depending_on_working_dir_during_add.mdwn +++ b/doc/bugs/WORM_keys_differ_depending_on_working_dir_during_add.mdwn @@ -55,3 +55,14 @@ $ readlink quux Linux 3.15.8 git-annex 5.20140716 + +> This was a bug. I suspect it got broken a while ago and I didn't noticed +> since I rarely use WORM and when I do it's almost always adding files +> in the current directory. [[fixed|done]] to take the filename only. +> +> I don't think it's a problem to have the subdirectory path in the +> existing WORM keys, other than the problems you note with this meaning +> a later add of the same file will generate a different key. So I have not +> done anything to try to fix up existing keys. (If this became a problem, +> I could add upgrade code to the WORM backend.) +> --[[Joey]]