aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-15 13:30:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-15 13:30:04 -0400
commit984c9fc0523bcd3bfcd7de83f4f7974daa6872bc (patch)
tree21b8ad88a6f300b98a21f6f3e4644920fa24c058 /doc
parent81984e60acb920fffc969818e63604060636aa09 (diff)
remove optimize subcommand; use --auto instead
get, drop: Added --auto option, which decides whether to get/drop content as needed to work toward the configured numcopies. The problem with bundling it up in optimize was that I then found I wanted to run an optmize that did not drop files, only got them. Considered adding a --only-get switch to it, but that seemed wrong. Instead, let's make existing subcommands optionally smarter. Note that the only actual difference between drop and drop --auto is that the latter does not even try to drop a file if it knows of not enough copies, and does not print any error messages about files it was unable to drop. It might be nice to make get avoid asking git for attributes when not in auto mode. For now it always asks for attributes.
Diffstat (limited to 'doc')
-rw-r--r--doc/git-annex.mdwn22
-rw-r--r--doc/walkthrough.mdwn2
-rw-r--r--doc/walkthrough/automatically_managing_content.mdwn38
-rw-r--r--doc/walkthrough/optimizing_repositories.mdwn13
4 files changed, 54 insertions, 21 deletions
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index 8264c31b3..83bfc7e40 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -76,12 +76,19 @@ Many git-annex commands will stage changes for later `git commit` by you.
will involve copying them from another repository, or downloading them,
or transferring them from some kind of key-value store.
+ When the --auto switch is used, only gets content of files if needed
+ to satisfy the setting of annex.numcopies
+
* drop [path ...]
Drops the content of annexed files from this repository.
- git-annex may refuse to drop content if it does not think
- it is safe to do so, typically because of the setting of annex.numcopies.
+ git-annex will refuse to drop content if it cannot verify it is
+ safe to do so. At least one copy of content needs to exist in another
+ remote. This can be overridden with the --force switch.
+
+ When the --auto switch is used, only tries to drop content if
+ more than annex.numcopies copies exist.
* move [path ...]
@@ -157,11 +164,6 @@ Many git-annex commands will stage changes for later `git commit` by you.
To avoid expensive checksum calculations, specify --fast
-* optimize [path ...]
-
- Either gets or drops file content, as needed, to work toward meeting the
- configured numcopies setting.
-
* unused
Checks the annex for data that does not correspond to any files present
@@ -340,6 +342,12 @@ Many git-annex commands will stage changes for later `git commit` by you.
Enables less expensive, but also less thorough versions of some commands.
What is avoided depends on the command.
+* --auto
+
+ Enable automatic mode, in which git-annex decides whether to perform
+ actions on files. See descriptions of individual commands to see what
+ they do in automatic mode.
+
* --quiet
Avoid the default verbose display of what is done; only show errors
diff --git a/doc/walkthrough.mdwn b/doc/walkthrough.mdwn
index b0eb25815..68f94a6f2 100644
--- a/doc/walkthrough.mdwn
+++ b/doc/walkthrough.mdwn
@@ -18,6 +18,6 @@ A walkthrough of the basic features of git-annex.
fsck:_verifying_your_data
fsck:_when_things_go_wrong
backups
- optimizing_repositories
+ automatically_managing_content
more
"""]]
diff --git a/doc/walkthrough/automatically_managing_content.mdwn b/doc/walkthrough/automatically_managing_content.mdwn
new file mode 100644
index 000000000..74a4c1b5b
--- /dev/null
+++ b/doc/walkthrough/automatically_managing_content.mdwn
@@ -0,0 +1,38 @@
+Once you have multiple repositories, and have perhaps configured numcopies,
+any given file can have many more copies than is needed, or perhaps fewer
+than you would like. How to manage this?
+
+The whereis subcommand can be used to see how many copies of a file are known,
+but then you have to decide what to get or drop. In this example, there
+are rather too many copies of `other_file` and perhaps not enough of the
+other file.
+
+ # cd /media/usbdrive
+ # git annex whereis
+ whereis my_cool_big_file (1 copy)
+ 0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
+ whereis other_file (3 copies)
+ 0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
+ 62b39bbe-4149-11e0-af01-bb89245a1e61 -- usb drive <-- here
+ 7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
+
+What would be handy is some automated versions of get and drop, that only
+get a file if there are not yet enough copies of it, or only drop a file
+if there are too many copies. Well, these exist, just use the --auto
+option.
+
+ # git annex get --auto --numcopies=2
+ get my_cool_big_file (from laptop...) ok
+ # git annex drop --auto --numcopies=2
+ drop other_file ok
+
+With two quick commands, git-annex was able to decide for you how to
+work toward having two copies of your files.
+
+ # git annex whereis
+ whereis my_cool_big_file (2 copies)
+ 0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
+ 62b39bbe-4149-11e0-af01-bb89245a1e61 -- usb drive <-- here
+ whereis other_file (2 copies)
+ 0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
+ 7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
diff --git a/doc/walkthrough/optimizing_repositories.mdwn b/doc/walkthrough/optimizing_repositories.mdwn
deleted file mode 100644
index 0f17f1dea..000000000
--- a/doc/walkthrough/optimizing_repositories.mdwn
+++ /dev/null
@@ -1,13 +0,0 @@
-Once you have multiple repositories, and have perhaps configured numcopies,
-any given file can have many more copies than is needed, or perhaps fewer
-than you would like. Fsck can detect the latter problem, but there's another
-command that can help deal with both problems.
-
-The optimize subcommand either gets or drops file content, as needed,
-to work toward meeting the configured numcopies setting.
-
- # git annex optimize
- get my_cool_big_file (from laptop...) ok
- drop other_file ok
- # git annex optimize --numcopies=2
- get other_file ok