From 67dcc1f171f0bbe2b57d20fbafce9f6c9b8f781e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Jul 2011 19:29:36 -0400 Subject: add: Avoid a failure mode that resulted in the file seemingly being deleted (content put in the annex but no symlink present). --- Command/Add.hs | 4 ++-- debian/changelog | 2 ++ doc/bugs/git_annex_add_eats_files_when_filename_is_too_long.mdwn | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Command/Add.hs b/Command/Add.hs index 2831e1b35..e7d16b6c0 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -51,11 +51,11 @@ perform (file, backend) = do cleanup :: FilePath -> Key -> CommandCleanup cleanup file key = do - logStatus key InfoPresent - link <- calcGitLink file key liftIO $ createSymbolicLink link file + logStatus key InfoPresent + -- touch the symlink to have the same mtime as the file it points to s <- liftIO $ getFileStatus file let mtime = modificationTime s diff --git a/debian/changelog b/debian/changelog index ef0ec7719..eb9037771 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ git-annex (3.20110706) UNRELEASED; urgency=low * Bugfix: Forgot to de-escape keys when upgrading. Could result in bad location log data for keys that contain [&:%] in their names. (A workaround for this problem is to run git annex fsck.) + * add: Avoid a failure mode that resulted in the file seemingly being + deleted (content put in the annex but no symlink present). -- Joey Hess Tue, 05 Jul 2011 20:52:11 -0400 diff --git a/doc/bugs/git_annex_add_eats_files_when_filename_is_too_long.mdwn b/doc/bugs/git_annex_add_eats_files_when_filename_is_too_long.mdwn index af807b65d..d17e569f1 100644 --- a/doc/bugs/git_annex_add_eats_files_when_filename_is_too_long.mdwn +++ b/doc/bugs/git_annex_add_eats_files_when_filename_is_too_long.mdwn @@ -8,3 +8,7 @@ Recently I ran into the following situation under Ubuntu with an encrypted home The file seems to be completely gone. It no longer exists in the current directory, or under .git/annex. I don't mind horribly that git-annex failed due to the name length limit, but it shouldn't have deleted my file in the process (fortunately the file wasn't very important, or hard to recover). + +> [[done]], as noted it did not delete content and now it makes the symlink +> before trying to write to the location log, avoiding that gotcha. +> --[[Joey]] -- cgit v1.2.3