Commit graph

402 commits

Author SHA1 Message Date
Joey Hess
3e0d2a0803 add timestamp to uuid.log
* New or changed repository descriptions in uuid.log now have a timestamp,
  which is used to ensure the newest description is used when the uuid.log
  has been merged.
* Note that older versions of git-annex will display the timestamp as part
  of the repository description, which is ugly but otherwise harmless.
2011-10-06 15:31:25 -04:00
Joey Hess
d357556141 Add locking to avoid races when changing the git-annex branch. 2011-10-03 16:32:36 -04:00
Joey Hess
49f21dd9ba Contain the zombie hordes.a
Specifically, when using gpg, a zombie is forked for each file, so waiting
until shutdown to reap won't do.
2011-10-02 11:16:34 -04:00
Joey Hess
29032cb70e When displaying a list of repositories, show git remote names in addition to their descriptions. 2011-09-30 15:02:29 -04:00
Joey Hess
828f3f1b0c status: List all known repositories. 2011-09-30 03:20:24 -04:00
Joey Hess
a7e7dda55a Fix referring to remotes by uuid.
I think that I broke this in some fairly recent refactoring.
2011-09-30 02:23:24 -04:00
Joey Hess
7ff89ccfee convert all git read/write functions to use ByteStrings
This yields a second or so speedup in unused, find, etc. Seems that even
when the ByteString is immediately split and then converted to Strings,
it's faster.

I may try to push ByteStrings out into more of git-annex gradually,
although I suspect most of the time-critical parts are already covered
now, and many of the rest rely on libraries that only support Strings.
2011-09-29 23:48:57 -04:00
Joey Hess
a91c8a15d5 Sped up unused.
Added Git.ByteString which replaces Git IO methods with ones using lazy
ByteStrings. This can be more efficient when large quantities of data are
being read from git.

In Git.LsTree, parse git ls-tree output more efficiently, thanks
to ByteString. This benchmarks 25% faster, in a benchmark that includes
(probably predominately) the run time for git ls-tree itself.

In real world numbers, this makes git annex unused 2 seconds faster for
each branch it needs to check, in my usual large repo.
2011-09-29 19:04:24 -04:00
Joey Hess
7dddb803a0 releasing version 3.20110928 2011-09-28 19:17:12 -04:00
Joey Hess
d75da353b9 documentation/warning message update for future feature 2011-09-23 18:04:38 -04:00
Joey Hess
9f5c7a246b status: Massively sped up; remove --fast mode.
Using Sets is the right thing; they have constant size lookup like my
SizeList, and logn insertation, which beats nub to death.

Runs faster than --fast mode did before, and gives accurate counts.

13 seconds total runtime with a warm cache in a repository with 40 thousand
keys.
2011-09-20 18:57:05 -04:00
Joey Hess
cabbefd9d2 status: In --fast mode, all status info is displayed now; but some of it is only approximate, and is marked as such. 2011-09-20 18:13:08 -04:00
Joey Hess
a4aef6f115 clarify wording 2011-09-19 01:54:20 -04:00
Joey Hess
33cd1ffbfe make find show files meeting limits, even when not present
find: Rather than only showing files whose contents are present, when used
with --exclude --copies or --in, displays all files that match the
specified conditions.

Note that this is a behavior change for find --exclude! Old behavior
can be gotten with find --in . --exclude=...
2011-09-18 20:42:15 -04:00
Joey Hess
9da23dff78 --copies=N can be used to make git-annex only operate on files with the specified number of copies.
(And --not --copies=N for the inverse.)
2011-09-18 20:23:08 -04:00
Joey Hess
1fc3ee2423 add --in limit 2011-09-18 20:14:18 -04:00
Joey Hess
3e73de4054 releasing version 3.20110915 2011-09-17 09:21:09 -04:00
Joey Hess
d036cd590f bugfix: drop and fsck did not honor --exclude 2011-09-15 15:44:32 -04:00
Joey Hess
a0d3a343b5 copy --auto
Only does copy when numcopies is not yet satisfied.
2011-09-15 15:28:58 -04:00
Joey Hess
984c9fc052 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.
2011-09-15 13:30:04 -04:00
Joey Hess
949b3f69d0 optimize: A new subcommand that either gets or drops file content as needed to work toward meeting the configured numcopies setting.
This is currently rather simplistic, though still useful.
In the future, it could become smarter about what content is stored where,
etc.
2011-09-14 13:47:22 -04:00
Joey Hess
03d6209e1c addurl: Always use whole url as destination filename, rather than only its file component.
First, this ensures that git annex addurl, when run repeatedly with the
same url, doesn't create duplicate files, which it did before when it
fell back to the longer filename.

Secondly, the file part of an url is frequently not very descriptive on its
own.

The uri scheme, auth, and port is intentionally left out, as clutter.
2011-09-07 19:04:51 -04:00
Joey Hess
72b54d6170 Fix build without S3. 2011-09-07 10:21:19 -04:00
Joey Hess
6f98fd5391 whereis: Show untrusted locations separately and do not include in location count. 2011-09-06 16:59:53 -04:00
Joey Hess
6fd0df7c2f releasing version 3.20110906 2011-09-06 15:54:21 -04:00
Joey Hess
ebb92221fd Fix Makefile to work with cabal again. 2011-09-06 15:35:13 -04:00
Joey Hess
07125dca53 Improve display of newlines around error and warning messages. 2011-09-06 13:46:08 -04:00
Joey Hess
d238bbd9d9 releasing version 3.20110902 2011-09-02 21:32:05 -04:00
Joey Hess
2f4d4d1c45 basic json support
This includes a generic JSONStream library built on top of Text.JSON
(somewhat hackishly).

It would be possible to stream out a single json document describing
all actions, but it's probably better for consumers if they can expect
one json document per line, so I did it that way instead.

Output from external programs used for transferring files is not
currently hidden when outputting json, which probably makes it not very
useful there. This may be dealt with if there is demand for json
output for --get or --move to be parsable.

The version, status, and find subcommands have hand-crafted output and
don't do json. The whereis subcommand needs to be modified to produce
useful json.
2011-09-01 15:22:06 -04:00
Joey Hess
f600444ab6 unused --remote: Reduced memory use to 1/4th what was used before.
Using a single strictness annotation, in just the right place.
Tried several others, none of which helped and some of which potentially
hurt. This is only the second time I've really had to deal with this in
a year of using haskell, which is, I suppose not that bad.
2011-08-31 19:13:02 -04:00
Joey Hess
ea7b1828d4 unused, status: Sped up by avoiding unnecessary stats of annexed files.
Statting files returned by dirContents to see if they exist and are regular
files seems pretty useless. This code was originally part of fsck, and
perhaps the idea then was to avoid things returned by dirContents that were
not files. But it's certianly not needed in the current use cases for
getKeysPresent.
2011-08-30 15:16:34 -04:00
Joey Hess
d1154d0837 init: Make description an optional parameter. 2011-08-29 14:13:38 -04:00
Joey Hess
6e750764b7 The wget command will now be used in preference to curl, if available.
Got tired of curl's various ugly progress bars.
2011-08-27 12:31:50 -04:00
Joey Hess
20259c2955 Set EMAIL when running test suite so that git does not need to be configured first. Closes: #638998 2011-08-23 13:41:32 -04:00
Joey Hess
3786f8d348 releasing version 3.20110819 2011-08-19 20:38:36 -04:00
Joey Hess
01cd775d92 Fix broken upgrade from V1 repository. Closes: #638584
Had forgotten to keep several old versions of functions needed during this
upgrade.
2011-08-19 20:32:18 -04:00
Joey Hess
8a2197adfa Added annex-cost-command configuration, which can be used to vary the cost of a remote based on the output of a shell command.
Also avoided crashing if the user specified cost value cannot be parsed.
2011-08-18 12:20:47 -04:00
Joey Hess
56f6923ccb Now "git annex init" only has to be run once
when a git repository is first being created. Clones will automatically
notice that git-annex is in use and automatically perform a basic
initalization. It's still recommended to run "git annex init" in any
clones, to describe them.
2011-08-17 14:44:31 -04:00
Joey Hess
f0c2130700 releasing version 3.20110817 2011-08-17 01:34:15 -04:00
Joey Hess
4a023dd1aa Added curl to Debian package dependencies. 2011-08-16 22:22:00 -04:00
Joey Hess
e6752cc064 Added support for getting content from git remotes using http (and https). 2011-08-16 21:12:48 -04:00
Joey Hess
dede05171b addurl: --fast can be used to avoid immediately downloading the url.
The tricky part about this is that to generate a key, the file must be
present already. Worked around by adding (back) an URL key type, which
is used for addurl --fast.
2011-08-06 14:57:22 -04:00
Joey Hess
45bbf210a1 Fix shell escaping in rsync special remote. 2011-07-29 15:28:21 +02:00
Joey Hess
a8a71b9d91 releasing version 3.20110719 2011-07-19 23:52:09 -04:00
Joey Hess
ec9e9343d9 add closure for new bug that I already fixed 2011-07-17 19:05:50 -04:00
Joey Hess
ded2591124 unannex: Clean up use of git commit -a.
This was more complex than would be expected. unannex has to use git commit -a
since it's removing files from git; git commit filelist won't do.

Allow commands to be added to the Git queue that have no associated files,
and run such commands once.
2011-07-14 17:15:37 -04:00
Joey Hess
0c46cbab09 Support the standard git -c name=value
This allows eg, `git-annex -c annex.rsync-options=-6 get file`

The overridden git configs are not passed on to git plumbing commands
that are run. Perhaps someone will find a need to do that, but I don't yet
and it would require storing more state to know what config settings
have been overridden and need to be passed on.
2011-07-14 16:51:20 -04:00
Joey Hess
7919de73af Bugfix: Make add ../ work.
The complication of check-attr returning absolute paths that have to be
converted back to relative paths..
2011-07-10 13:52:53 -04:00
Joey Hess
40c6ba99f5 add: Be even more robust to avoid ever leaving the file seemingly deleted.
A failure at any point after the file is annexed will result in an undo
that puts the original file back into place and wipes the location log.
2011-07-07 21:30:51 -04:00
Joey Hess
4d4f297c96 releasing version 3.20110707 2011-07-07 19:37:49 -04:00
Joey Hess
67dcc1f171 add: Avoid a failure mode that resulted in the file seemingly being deleted (content put in the annex but no symlink present). 2011-07-07 19:29:36 -04:00
Joey Hess
2fb771f135 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.)

`git annex unused --from remote` could also run into the broken code.
2011-07-07 17:04:21 -04:00
Joey Hess
497b1e6092 Fix sign bug in disk free space checking.
Giulio Eulisse reported that on OSX, bad free space numbers were being
shown. It thought he had negative free space.

While the documentation is not clear, especially across OS's, it seems
likely that statfs uses unsigned long. It doesn't make sense for any
numbers to be negative.
2011-07-05 20:53:58 -04:00
Joey Hess
d583e04d23 releasing version 3.20110705 2011-07-05 15:21:38 -04:00
Joey Hess
5c69ac14eb Drop the dependency on the haskell curl bindings, use regular haskell HTTP. 2011-07-04 19:33:11 -04:00
Joey Hess
71c783bf24 uninit: Use unannex in --fast mode, to support unannexing multiple files that link to the same content. 2011-07-04 16:20:50 -04:00
Joey Hess
22a4f5b348 unannex: In --fast mode, file content is left in the annex, and a hard link made to it. 2011-07-04 16:06:28 -04:00
Joey Hess
5beb6bc76f uninit: delete .git/annex/ 2011-07-04 15:55:03 -04:00
Joey Hess
5c63b409d4 uninit: Delete the git-annex branch. 2011-07-04 15:50:30 -04:00
Joey Hess
48db40857c releasing version 3.20110702 2011-07-02 15:08:05 -04:00
Joey Hess
457d28c676 wording 2011-07-01 17:24:11 -04:00
Joey Hess
a140f7148f documentation for using the web 2011-07-01 16:05:06 -04:00
Joey Hess
cdbcd6f495 add web special remote
Generalized LocationLog to PresenceLog, and use a presence log to record
urls for the web special remote.
2011-07-01 15:30:42 -04:00
Joey Hess
ee3a0551a7 Merge branch 'master' into v3
Conflicts:
	debian/changelog
2011-06-30 15:01:08 -04:00
Joey Hess
56aeeb4565 cabal can now be used to build git-annex.
This is substantially slower than using make, does not build or install
documentation, does not run the test suite, and is not particularly
recommended, but could be useful to some.
2011-06-30 14:55:03 -04:00
Joey Hess
8562e6096c v3 is now faster than v2
Rebenchmarked v2 vs v3, and v3 is now actually faster. Yes, storing data
in git, using git as a filesystem is actually faster than just using the
filesystem. If you do it just right. :)
2011-06-30 01:16:53 -04:00
Joey Hess
d72fb5acc2 Fix encoding of utf-8 etc when storing the description of repository and other content.
Write files in raw mode, to avoid mangling the encoding of content
provided.

Note: This was a longstanding problem, it was not introduced in v3.
2011-06-30 00:35:51 -04:00
Joey Hess
e1c18ddec4 Sped back up fsck, copy --from etc
All commands that often have to read a lot of information from
the git-annex branch should now be nearly as fast as before
the branch was introduced.

Before fsck was taking approximatly 3 hours, now it's running in 8 minutes.

The code is very nasty. It should be rewritten to read the header line
from git cat-file, and then read the specified number of bytes of content.
2011-06-29 21:47:31 -04:00
Joey Hess
af45d42224 Merge branch 'master' into v3
Conflicts:
	debian/changelog
2011-06-29 11:42:35 -04:00
Joey Hess
b3aaf980e4 --force will cause add, etc, to operate on ignored files. 2011-06-29 11:42:00 -04:00
Joey Hess
5034d8c298 Modify location log parser to allow future expansion.
Since the logs have just been moved into the git-annex branch, don't need
to worry about backwards compatability with old versions of git-annex that
would fail to parse location logs with extra fields tacked on.
2011-06-28 16:15:50 -04:00
Joey Hess
c90652f015 Always ensure git-annex branch exists. 2011-06-26 22:43:48 -04:00
Joey Hess
874fc044c1 releasing version 3.20110624 2011-06-24 14:58:07 -04:00
Joey Hess
7ee636f6dd avoid unnecessary read of trust.log 2011-06-23 13:39:04 -04:00
Joey Hess
66ceb92702 docs 2011-06-22 23:37:46 -04:00
Joey Hess
68783fd5e0 let's have the major version number be annex.version 2011-06-22 23:02:58 -04:00
Joey Hess
ad3770e0b2 add merge subcommand 2011-06-22 18:46:56 -04:00
Joey Hess
80302d0b46 improve bare repo handing
Many more commands can work in bare repos now, thanks to the git-annex
branch.
2011-06-22 18:32:41 -04:00
Joey Hess
818ae0c6da docs for v3 2011-06-21 20:21:33 -04:00
Joey Hess
9f9e17aa0f unlock: Made atomic. 2011-06-20 22:38:18 -04:00
Joey Hess
c835166a7c add git-union-merge
This is a new git subcommand, that does a generic union merge operation
between two refs, storing the result in a branch. It operates efficiently
without touching the working tree. It does need to write out a temporary
index file, and may need to write out some other temp files as well.

This could be useful for anything that stores data in a branch,
and needs to merge changes into that branch without actually checking the
branch out. Since conflict handling can't be done without a working copy,
the merge type is always a union merge, which is fine for data stored in
log format (as git-annex does), or in non-conflicting files
(as pristine-tar does).

This probably belongs in git proper, but it will live in git-annex for now.

---

Plan is to move .git-annex/ to a git-annex branch, and use git-union-merge
to handle merging changes when pulling from remotes.

Some preliminary benchmarking using real .git-annex/ data indicates
that it's quite fast, except for the "git add" call, which is as slow
as "git add" tends to be with a big index.
2011-06-20 21:37:18 -04:00
Joey Hess
f547277b75 Allow --trust etc to specify a repository by name, for temporarily trusting repositories that are not configured remotes. 2011-06-13 22:19:44 -04:00
Joey Hess
30d7cce7ec rsync is now used when copying files from repos on other filesystems
cp is still used when copying file from repos on the same filesystem, since
--reflink=auto can make it significantly faster on filesystems such as
btrfs.

Directory special remotes still use cp, not rsync. It's not clear what
tmp file should be used when rsyncing to such a remote.
2011-06-13 20:33:52 -04:00
Joey Hess
38e0100a69 releasing version 0.20110610 2011-06-10 11:58:21 -04:00
Joey Hess
9a272815dd Bugfix: Fix fsck to not think all SHAnE keys are bad. 2011-06-10 11:43:28 -04:00
Joey Hess
90dd245522 get --from is the same as copy --from
get not honoring --from has surprised me a few times, so least surprise
suggests it should just behave like copy --from. This leaves the difference
between get and copy being that copy always requires the remote to copy
from, while get will decide whether to get a file from a key/value store or
a remote.
2011-06-09 18:54:49 -04:00
Joey Hess
a8fb97d2ce Add --trust, --untrust, and --semitrust options. 2011-06-01 17:57:31 -04:00
Joey Hess
3d567aa64f Add --numcopies option. 2011-06-01 16:49:17 -04:00
Joey Hess
dc92a788c7 releasing version 0.20110601 2011-06-01 12:00:25 -04:00
Joey Hess
038da52bdd Somewhat sped up git commit of modifications to unlocked files.
Avoid git reset here too, so I no longer need to care that it's much more
expensive than seems wise (but I asked the git list about that anyway).

It's not necessary to reset the staged file content from the index, as
the `git add` of the the symlink will replace it anyway.

`git commit` of unlocked files is still slow, since git still has to shove
their entire content into the index, only to have it be thrown away. So it's
still better to use `git annex add`
2011-05-31 16:08:37 -04:00
Joey Hess
fb259033d4 Fix locking of files with staged changes.
Previously, lock would skip files that had staged changes, but that is
counterintuitive, I think.
2011-05-31 15:00:56 -04:00
Joey Hess
fafe60768f Massively sped up git annex lock by avoiding use of the uber-slow git reset, and only running git checkout once, even when many files are being locked. 2011-05-31 14:50:41 -04:00
Joey Hess
14ffb5d47b bugfix: fix unused list numbering
Introduced in 43f0a666f0
2011-05-28 22:30:06 -04:00
Joey Hess
7ea54e1c6e releasing version 0.20110522 2011-05-27 20:28:01 -04:00
Joey Hess
001edb008a Fix bug in --exclude introduced in 0.20110516. 2011-05-27 20:20:20 -04:00
Joey Hess
5b941980aa Closer emulation of git's behavior when told to use "foo/.git" as a git repository instead of just "foo". Closes: #627563 2011-05-22 14:12:16 -04:00
Joey Hess
944b1207dc releasing version 0.20110521 2011-05-21 11:58:35 -04:00
Joey Hess
93a4f3d4e6 Add --debug option. Closes: #627499
This takes advantage of the debug logging done by missingh, and I added
my own debug messages for executeFile calls. There are still some other
low-level ways git-annex runs stuff that are not shown by debugging,
but this gets most of it easily.
2011-05-21 11:52:13 -04:00
Joey Hess
cd83541872 --backend now overrides any backend configured in .gitattributes files. 2011-05-18 19:34:46 -04:00
Joey Hess
a8816efc14 status: New subcommand to show info about an annex, including its size. 2011-05-16 21:18:34 -04:00