This commit is contained in:
Joey Hess 2010-10-12 02:00:29 -04:00
parent eea55856e9
commit c8002bd91b
3 changed files with 51 additions and 11 deletions

View file

@ -31,7 +31,9 @@ import Network.URI
import Maybe import Maybe
import Utility import Utility
{- A git repository can be local or remote. -} {- A git repository can be on local disk or remote. Not to be confused
- with a git repo's configured remotes, some of which may be on local
- disk. -}
data GitRepo = data GitRepo =
LocalGitRepo { LocalGitRepo {
top :: FilePath, top :: FilePath,

34
TODO
View file

@ -1,7 +1,39 @@
* bug when annexing files in a subdir of a git repo * bug when annexing files in a subdir of a git repo
* how to handle git mv file? * how to handle git mv file?
* query remotes for their annex.name settings * query remotes for their annex.name settings, or figure out a different
solution to nameing problem?
- querying network remotes all the time will be slow. local caching in
.git/config?
- having a git annex name and a git remote name that are distinct
will be confusing
- but git remote names are repo-local, I want a global name
- really, I don't want a name at all, I want a per-repo UUID
So, each repo has a UUID, stored in annex.uuid.
And also, the last seen UUID for each remote is listed:
remote.origin.annex-uuid=d3d2474c-d5c3-11df-80a9-002170d25c55
Then when it need to find a repo by UUID, it can see if a known remote
has it -- and then query the remote to confirm the repo there still has
that UUID (a different repo may have been mounted there).
Failing that, it can force a refresh of all uuids, updating .git/config,
and check again.
- Only downside for this is that if I put a repo on a usb disk,
and it is disconnected and I have no remote for it,
git-annex will have to say:
"You asked for a file that is only present on a git repo with
UUID d3d2474c-d5c3-11df-80a9-002170d25c55 -- and I don't know
where it is."
To solve that, let .git-annex/uuid.map map between uuids and descriptions,
like "d3d2474c-d5c3-11df-80a9-002170d25c55 SATA drive labeled '* arch-2'"
* hook up LocationLog * hook up LocationLog
* --push/--pull/--get/--want/--drop * --push/--pull/--get/--want/--drop

View file

@ -79,7 +79,7 @@ git-annex information that should be propigated between repositories.
Data is stored here in files that are arranged to avoid conflicts in most Data is stored here in files that are arranged to avoid conflicts in most
cases. A conflict could occur if a file with the same name but different cases. A conflict could occur if a file with the same name but different
content was added to multiple clones. content was added to multiple repositories.
## key/value storage ## key/value storage
@ -117,26 +117,32 @@ you indicate you --want a file, git-annex will tell you which repositories
have the file's content. have the file's content.
Location tracking information is stored in `.git-annex/$filename.log`. Location tracking information is stored in `.git-annex/$filename.log`.
Repositories record their name and the date when they --get or --drop Repositories record their UUID and the date when they --get or --drop
a file's content. (Git is configured to use a union merge for this file, a file's content. (Git is configured to use a union merge for this file,
so the lines may be in arbitrary order, but it will never conflict.) so the lines may be in arbitrary order, but it will never conflict.)
The optional file `.git-annex/uuid.map` can be created to add a description
to a UUID. If git-annex needs a file from a repository and it cannot find
the repository amoung the remotes, it will use the description from this
file when asking for the repository to be made available. The file format
is a UUID, a space, and the rest of the line is its description. For
example:
UUID d3d2474c-d5c3-11df-80a9-002170d25c55 USB drive in red enclosure
## configuration ## configuration
* `annex.numcopies` -- number of copies of files to keep * `annex.uuid` -- a unique UUID for this repository
* `annex.numcopies` -- number of copies of files to keep (default: 1)
* `annex.backends` -- space-separated list of names of * `annex.backends` -- space-separated list of names of
the key/value backends to use. The first listed is used to store the key/value backends to use. The first listed is used to store
new files. new files. (default: file, checksum, url)
* `annex.name` -- allows specifying a unique name for this repository.
If not specified, the name is derived from its directory's location and
the hostname. When a repository is on removable media it is useful to give
it a more stable name. Typically the name of a repository is the same
name configured as a git remote to allow pulling from that repository.
* `remote.<name>.annex-cost` -- When determining which repository to * `remote.<name>.annex-cost` -- When determining which repository to
transfer annexed files from or to, ones with lower costs are preferred. transfer annexed files from or to, ones with lower costs are preferred.
The default cost is 50. Note that other factors may be configured The default cost is 50. Note that other factors may be configured
when pushing files to repositories, in particular, whether the repository when pushing files to repositories, in particular, whether the repository
is on a filesystem with sufficient free space. is on a filesystem with sufficient free space.
* `remote.<name>.annex-uuid` -- git-annex caches UUIDs of remotes here
## issues ## issues