reorg .git/annex

This commit is contained in:
Joey Hess 2010-11-08 15:14:54 -04:00
parent ab4de45491
commit 02a21d7f27
3 changed files with 18 additions and 9 deletions

View file

@ -13,7 +13,8 @@ module Locations (
annexLocation,
annexLocationRelative,
annexTmpLocation,
annexDir
annexDir,
annexObjectDir
) where
import Data.String.Utils
@ -29,7 +30,7 @@ gitStateDir :: Git.Repo -> FilePath
gitStateDir repo = (Git.workTree repo) ++ "/" ++ stateLoc
{- An annexed file's content is stored in
- /path/to/repo/.git/annex/<key>, where <key> is of the form
- /path/to/repo/.git/annex/objects/<key>/<key>, where <key> is of the form
- <backend:fragment>
-
- That allows deriving the key and backend by looking at the symlink to it.
@ -42,7 +43,8 @@ annexLocation r key =
-
- Note: Assumes repo is NOT bare.-}
annexLocationRelative :: Key -> FilePath
annexLocationRelative key = ".git/annex/" ++ (keyFile key)
annexLocationRelative key = ".git/annex/objects/" ++ f ++ f
where f = keyFile key
{- The annex directory of a repository.
-
@ -50,6 +52,11 @@ annexLocationRelative key = ".git/annex/" ++ (keyFile key)
annexDir :: Git.Repo -> FilePath
annexDir r = Git.workTree r ++ "/.git/annex"
{- The part of the annex directory where file contents are stored.
-}
annexObjectDir :: Git.Repo -> FilePath
annexObjectDir r = annexDir r ++ "/objects"
{- .git-annex/tmp is used for temp files -}
annexTmpLocation :: Git.Repo -> FilePath
annexTmpLocation r = annexDir r ++ "/tmp/"

2
debian/changelog vendored
View file

@ -2,6 +2,8 @@ git-annex (0.04) UNRELEASED; urgency=low
* Add build dep on libghc6-testpack-dev.
* Add annex.version, which will be used to automate upgrades.
* Reorganised the layout of .git/annex/ , moving cached file contents
to .git/annex/objects/<key>/<key>
-- Joey Hess <joeyh@debian.org> Mon, 08 Nov 2010 12:36:39 -0400

View file

@ -10,13 +10,13 @@ Multiple pluggable backends are supported, and a single repository
can use different backends for different files.
* `WORM` ("Write Once, Read Many") This backend stores the file's content
only in `.git/annex/`, and assumes that any file with the same basename,
size, and modification time has the same content. So with this backend,
files can be moved around, but should never be added to or changed.
This is the default, and the least expensive backend.
only in `.git/annex/objects/`, and assumes that any file with the same
basename, size, and modification time has the same content. So with
this backend, files can be moved around, but should never be added to
or changed. This is the default, and the least expensive backend.
* `SHA1` -- This backend stores the file's content in
`.git/annex/`, with a name based on its sha1 checksum. This backend allows
modifications of files to be tracked. Its need to generate checksums
`.git/annex/objects/`, with a name based on its sha1 checksum. This backend
allows modifications of files to be tracked. Its need to generate checksums
can make it slower for large files. **Warning** this backend is not ready
for use.
* `URL` -- This backend downloads the file's content from an external URL.