From 89ee70c43afd12f15c2ee796036f96c620d8becb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Mar 2012 00:41:48 -0400 Subject: [PATCH 1/5] status: More accurate display of sizes of tmp and bad keys. Can't trust the key size to be accurate for tmp and bad keys, so check actual file size. In the wild I saw the old code be wrong by a factor of about 100! If all tmp/bad keys are empty, they're not shown in status at all. Showing 0 bytes and suggesting to clean it up seemed weird.. --- Command/Status.hs | 19 +++++++++++++------ debian/changelog | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Command/Status.hs b/Command/Status.hs index 0b1741dc0a..96345e92b5 100644 --- a/Command/Status.hs +++ b/Command/Status.hs @@ -211,12 +211,19 @@ showSizeKeys d = total ++ missingnote " keys of unknown size" staleSize :: String -> (Git.Repo -> FilePath) -> Stat -staleSize label dirspec = do - keys <- lift (Command.Unused.staleKeys dirspec) - if null keys - then nostat - else stat label $ json (++ aside "clean up with git-annex unused") $ - return $ showSizeKeys $ foldKeys keys +staleSize label dirspec = go =<< lift (Command.Unused.staleKeys dirspec) + where + go [] = nostat + go keys = onsize =<< sum <$> keysizes keys + onsize 0 = nostat + onsize size = stat label $ + json (++ aside "clean up with git-annex unused") $ + return $ roughSize storageUnits False size + keysizes keys = map (fromIntegral . fileSize) <$> stats keys + stats keys = do + dir <- lift $ fromRepo dirspec + liftIO $ forM keys $ \k -> + getFileStatus (dir keyFile k) aside :: String -> String aside s = " (" ++ s ++ ")" diff --git a/debian/changelog b/debian/changelog index 120513806e..8fc2cc3304 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ git-annex (3.20120310) UNRELEASED; urgency=low space, but now only needs to store the set of file contents that are present in the annex in memory. * status: Fixed to run in constant space. + * status: More accurate display of sizes of tmp and bad keys. -- Joey Hess Sat, 10 Mar 2012 14:03:22 -0400 From 98ff74a85158bbc8bf1cea9d642cee25e6e02eb3 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawne9wwsAaMzo0kGyidj6PW_3_IA8eeDv7Y" Date: Mon, 12 Mar 2012 05:16:28 +0000 Subject: [PATCH 2/5] --- doc/forum/windows_port__63__.mdwn | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/forum/windows_port__63__.mdwn diff --git a/doc/forum/windows_port__63__.mdwn b/doc/forum/windows_port__63__.mdwn new file mode 100644 index 0000000000..092b8f8e1c --- /dev/null +++ b/doc/forum/windows_port__63__.mdwn @@ -0,0 +1,2 @@ +Any progress on Windows port? That would be very nice to have! +Depending on the scale of it, I might be able to help. From a886fe16015ef3859e311435456691bb28ebdad5 Mon Sep 17 00:00:00 2001 From: "http://joey.kitenet.net/" Date: Mon, 12 Mar 2012 06:43:03 +0000 Subject: [PATCH 3/5] Added a comment --- .../comment_1_23fa9aa3b00940a1c1b3876c35eef019._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/windows_port__63__/comment_1_23fa9aa3b00940a1c1b3876c35eef019._comment diff --git a/doc/forum/windows_port__63__/comment_1_23fa9aa3b00940a1c1b3876c35eef019._comment b/doc/forum/windows_port__63__/comment_1_23fa9aa3b00940a1c1b3876c35eef019._comment new file mode 100644 index 0000000000..95323ff997 --- /dev/null +++ b/doc/forum/windows_port__63__/comment_1_23fa9aa3b00940a1c1b3876c35eef019._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="http://joey.kitenet.net/" + nickname="joey" + subject="comment 1" + date="2012-03-12T06:43:02Z" + content=""" +[[todo/windows_support]] has everything I know about making a windows port. This badly needs someone who understand Windows to dive into it. The question of how to create a symbolic link (or the relevant Windows equivilant) from haskell on Windows +is a good starting point.. +"""]] From b6caf8997d59817eebdc5750ddbe4a31b3f3eb5f Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawl-J5N9y-JBa_GcOQ4VQXIF8MjAtxgN67w" Date: Mon, 12 Mar 2012 11:22:21 +0000 Subject: [PATCH 4/5] Formatting --- .../using_box.com_as_a_special_remote.mdwn | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/doc/tips/using_box.com_as_a_special_remote.mdwn b/doc/tips/using_box.com_as_a_special_remote.mdwn index f9e2fbba5d..917c7a93bd 100644 --- a/doc/tips/using_box.com_as_a_special_remote.mdwn +++ b/doc/tips/using_box.com_as_a_special_remote.mdwn @@ -13,21 +13,30 @@ With a little setup, git-annex can use Box as a * Allow users to mount davfs filesystems, by ensuring that `/sbin/mount.davfs` is setuid root. On Debian, just `sudo dpkg-reconfigure davfs2` * Add yourself to the davfs2 group. - sudo adduser $(whoami) davfs2 + + sudo adduser $(whoami) davfs2 + * Edit `/etc/fstab`, and add a line to mount Box using davfs. - sudo mkdir -p /media/box.com - echo "https://www.box.com/dav/ /media/box.com davfs noauto,user 0 0" | sudo tee -a /etc/fstab + + sudo mkdir -p /media/box.com + echo "https://www.box.com/dav/ /media/box.com davfs noauto,user 0 0" | sudo tee -a /etc/fstab + * Create `~/.davfs2/davfs2.conf` with some important settings: - mkdir ~/.davfs2/ - echo use_locks 0 >> ~/.davfs2/davfs2.conf - echo cache_size 1 >> ~/.davfs2/davfs2.conf - echo delay_upload 0 >> ~/.davfs2/davfs2.conf + + mkdir ~/.davfs2/ + echo use_locks 0 >> ~/.davfs2/davfs2.conf + echo cache_size 1 >> ~/.davfs2/davfs2.conf + echo delay_upload 0 >> ~/.davfs2/davfs2.conf + * Create `~/.davfs2/secrets`. This file contains your Box.com login and password. Your login is probably the email address you signed up with. - echo "/media/box.com joey@kitenet.net mypassword" > ~/.davfs2/secrets - chmod 600 ~/.davfs2/secrets + + echo "/media/box.com joey@kitenet.net mypassword" > ~/.davfs2/secrets + chmod 600 ~/.davfs2/secrets + * Now you should be able to mount Box, as a non-root user: - mount /media/box.com + + mount /media/box.com ## git-annex setup From 77fb50e01a8c66f87fdd79c9c4235074a0f55fa7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Mar 2012 16:20:17 -0400 Subject: [PATCH 5/5] bloom branch --- doc/download.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/download.mdwn b/doc/download.mdwn index 120e0a517d..2727cc1918 100644 --- a/doc/download.mdwn +++ b/doc/download.mdwn @@ -28,6 +28,8 @@ The git repository has some branches: library. * `tweak-fetch` adds support for the git tweak-fetch hook, which has been proposed and implemented but not yet accepted into git. +* `bloom` makes `git annex unused` use a bloom filter, thus running + in truely constant memory. Waiting on the haskell library being packaged. * `ghc7.0` supports versions of ghc older than 7.4, which had a major change to filename encoding. * `setup` contains configuration for this website