Commit graph

459 commits

Author SHA1 Message Date
Joey Hess
0b27e6baa0 Support unescaped repository urls, like git does.
Turns out that git will accept a .git/config containing an url with eg,
spaces in its name. Handle this by escaping the url if it's not valid.

This also fixes support for urls containing escaped characters like %20
for space. Before, the path from the url was not unescaped properly.
2012-01-05 14:32:20 -04:00
Joey Hess
338d472ca2 releasing version 3.20120105 2012-01-05 13:51:13 -04:00
Joey Hess
769edd6b08 Run gpg with --no-tty. Closes: #654721 2012-01-05 13:44:09 -04:00
Joey Hess
a1aea174d7 fsck: Do backend-specific check before checking numcopies is satisfied.
This way, when a checksum check fails and the content is moved aside,
the numcopies check also warns if there are not enough copies.
2012-01-03 18:40:47 -04:00
Joey Hess
7e6a54f984 Added quickcheck to build dependencies, and fail if test suite cannot be built. 2012-01-03 14:52:20 -04:00
Joey Hess
34abd7bca8 no implicit dotfiles in add
Dotfiles, and files inside dotdirs are not added by "git annex add" unless
the dotfile or directory is explicitly listed. So "git annex add ." will
add all untracked files in the current directory except for those in
dotdirs.

One reason for this is that it will make git-annex more usable with vcsh,
where you don't want "vcsh big annex add" to check in all the dotfiles
that are already versioned in other repositories.

(If you're using vcsh for repos that contain non-dotfiles, this won't help,
and you'll need to .gitignore such things, but this will cover the common
case.)

A more general reason why this seems like a good idea is the same reason ls
ignores dotfiles, just the unix convention that they are cruft that is kept
out of the way most of the time.

All the other git-annex commands still do deal with any dotfiles that do
get into the annex. This seemed right because if I've gone to the trouble
to add a dotfile, I will want "git annex get ." to get it along with
everything else.
2012-01-03 00:11:00 -04:00
Joey Hess
f0c4a1c770 annex.web-options also works 2012-01-02 14:22:50 -04:00
Joey Hess
aa0882691b Added remote.name.annex-web-options configuration setting, which can be used to provide parameters to whichever of wget or curl git-annex uses (depends on which is available, but most of their important options suitable for use here are the same). 2012-01-02 14:20:20 -04:00
Joey Hess
9b12701b9e releasing version 3.20111231 2011-12-31 15:07:45 -04:00
Joey Hess
e7d3e546c2 sync --fast: Selects some of the remotes with the lowest annex.cost and syncs those, in addition to any specified at the command line. 2011-12-30 21:17:36 -04:00
Joey Hess
dd8451f0f8 update 2011-12-30 20:40:59 -04:00
Joey Hess
8f4fdb3f97 Merge branch 'new-monad-control'
Conflicts:
	debian/changelog
2011-12-30 20:08:01 -04:00
Joey Hess
5287d1dc3f fixed behavior when multiple insteadOf configs are provided for the same url base
Consider this git config --list case:

url.git+ssh://git@example.com/.insteadOf=gl
url.git+ssh://git@example.com/.insteadOf=shared

Since config is stored in a Map, only the last of the values for this key
was stored and available for use by the insteadOf code. But that
is wrong; git allows either "gl" or "shared" to be used in an url and
the insteadOf value to be substituted in.

To support this, it seems best to keep the existing config map as-is,
and add a second map that accumulates a list of multiple values for
config keys. This new fullconfig map can be used in the rare places where
multiple values for a key make sense, without needing to complicate
everything else.

Haskell's laziness and data sharing keep the overhead of adding
this second map low.
2011-12-30 14:07:46 -04:00
Joey Hess
85f1f3a63a Updated to build with monad-control 0.3. 2011-12-24 23:05:23 -04:00
Joey Hess
fdf02986cf find --json 2011-12-23 01:08:19 -04:00
Joey Hess
06bafae9e0 Format strings can be specified using the new --find option, to control what is output by git annex find. 2011-12-22 18:31:44 -04:00
Joey Hess
5a275a3f5d Can now be built with older git versions (before 1.7.7); the resulting binary should only be used with old git.
Remove git old version check from configure, and use the git version
it was built against in the git check-attr code.
2011-12-22 15:01:13 -04:00
Joey Hess
6bffe509d7 Add --include, which is the same as --not --exclude. 2011-12-22 14:00:17 -04:00
Joey Hess
20482712d0 Improve deletion of files from rsync special remotes. Closes: #652849
Rsync is only run once, with include / exclude rules used to specify
exactly what to delete. This is faster, and avoids ugly error messages
from rsync, and doesn't fail if the content already got deleted somehow.
2011-12-21 16:57:03 -04:00
Joey Hess
a76b13b848 test fsck in bare repos (75%) 2011-12-21 14:20:41 -04:00
Joey Hess
8cdcd78b21 test bup special remote (74% coverage) 2011-12-21 13:50:33 -04:00
Joey Hess
c61f3d7b7b test coverage improvements 2011-12-21 12:46:14 -04:00
Joey Hess
82a145df91 test encrypted special remote
This involved adding a test harness to run gpg with a dummy key, and lots
of fun.
2011-12-20 23:24:06 -04:00
Joey Hess
cc88abd0ad Test suite improvements. Current top-level test coverage: 68%
Been higher before, but a lot of new code has been added.
2011-12-20 17:31:25 -04:00
Joey Hess
1c28237e0c map: --fast disables use of dot to display map
Generally useful, and allows the test suite to test it.
2011-12-20 16:42:35 -04:00
Joey Hess
da0bdc1a57 Fix the hook special remote, which bitrotted a while ago. 2011-12-20 12:23:49 -04:00
Joey Hess
09cd042775 Properly handle multiline git config values.
A crash on parsing was fixed a while ago. This adds support for fully
correctly parsing multiline git config values, using git config --null.

Since git-annex-shell configlist uses normal git config output, I left in
support for that too; the two forms of config output can be easily
identified by the parser. Since configlist only prints the annex.uuid
config, there's no risk of multiline values there, so no need to change it.
2011-12-15 12:48:27 -04:00
Joey Hess
6edaabd040 reinject: Add a sanity check for using an annexed file as the source file. 2011-12-12 13:43:52 -04:00
Joey Hess
acd7a52dfd always find optimal merge
Testing b9ac585454, it didn't find the
optimal union merge, the second sha was the one to use, at least in
the case I tried. Let's just try all shas to see if any can be reused.

I stopped using the expensive nub, so despite the use of sets to
sort/uniq file contents, this is probably as fast or faster than it
was before.
2011-12-12 01:59:29 -04:00
Joey Hess
acb2d5a5a6 releasing version 3.20111211 2011-12-11 21:55:51 -04:00
Joey Hess
8680c415de slow, stupid, and safe index updating
Always merge the git-annex branch into .git/annex/index before making a
commit from the index.

This ensures that, when the branch has been changed in any way
(by a push being received, or changes pulled directly into it, or
even by the user checking it out, and committing a change), the index
reflects those changes.

This is much too slow; it needs to be optimised to only update the
index when the branch has really changed, not every time.

Also, there is an unhandled race, when a change is made to the branch
right after the index gets updated. I left it in for now because it's
unlikely and I didn't want to complicate things with additional locking
yet.
2011-12-11 15:05:53 -04:00
Joey Hess
10e8028a42 Fix bug in last version in getting contents from bare repositories. 2011-12-10 18:45:55 -04:00
Joey Hess
c5267802f3 version dependency on old monad-control
This should let cabal build it with the right version.
2011-12-10 12:56:02 -04:00
Joey Hess
fb8231f3a1 sync: New command that synchronises the local repository and default remote, by running git commit, pull, and push for you. 2011-12-09 20:27:22 -04:00
Joey Hess
14e9b87d44 unannex improvements
Added files don't have to be committed before they can be unannexed.

unannex no longer commits existing staged changes

unannex of the last file in a directory now works, before it failed because
git rm deleted the directory out from under it,
2011-12-09 13:07:31 -04:00
Joey Hess
e3f1568e0f Fix caching of decrypted ciphers, which failed when drop had to check multiple different encrypted special remotes. 2011-12-08 16:01:46 -04:00
Joey Hess
8047bba5b9 add: If interrupted, add can leave files converted to symlinks but not yet added to git. Running the add again will now clean up this situtation. 2011-12-07 16:53:53 -04:00
Joey Hess
480495beb4 Prevent key names from containing newlines.
There are several places where it's assumed a key can be written on one
line. One is in the format of the .git/annex/unused files. The difficult
one is that filenames derived from keys are fed into git cat-file --batch,
which has a line based input. (And no -z option.)

So, for now it's best to block such keys being created.
2011-12-06 13:03:09 -04:00
Joey Hess
b6c8a0119a map: Fix a failure to detect a loop when both repositories are local and refer to each other with relative paths. 2011-12-04 12:23:10 -04:00
Joey Hess
ff5df842ea releasing version 3.20111203 2011-12-03 21:13:21 -04:00
Joey Hess
251c01d51e dead: A command which says that a repository is gone for good and you don't want git-annex to mention it again. 2011-12-02 16:59:55 -04:00
Joey Hess
fb68a7881f convert rsync special backend to using both hash directory types 2011-12-02 15:50:27 -04:00
Joey Hess
97f809c006 wording 2011-12-02 14:18:55 -04:00
Joey Hess
998d8f7968 clarify 2011-11-28 23:23:14 -04:00
Joey Hess
f4bf444ae0 store content in hashDirLower directories in bare repositories
When storing content in bare repositories, use the hashDirLower
directories. Bare repositories can be on USB drives, which might
use the FAT filesystem, and fall afoul of recent bugs in linux's handling
of mixed case on FAT. Using hashDirLower avoids that.
2011-11-28 22:55:40 -04:00
Joey Hess
e32ab766b0 --inbackend can be used to make git-annex only operate on files whose content is stored using a specified key-value backend. 2011-11-28 17:45:47 -04:00
Joey Hess
6869e6023e support .git/annex on a different disk than the rest of the repo
The only fully supported thing is to have the main repository on one disk,
and .git/annex on another. Only commands that move data in/out of the annex
will need to copy it across devices.

There is only partial support for putting arbitrary subdirectories of
.git/annex on different devices. For one thing, but this can require more
copies to be done. For example, when .git/annex/tmp is on one device, and
.git/annex/journal on another, every journal write involves a call to
mv(1). Also, there are a few places that make hard links between various
subdirectories of .git/annex with createLink, that are not handled.

In the common case without cross-device, the new moveFile is actually
faster than renameFile, avoiding an unncessary stat to check that a file
(not a directory) is being moved. Of course if a cross-device move is
needed, it is as slow as mv(1) of the data.
2011-11-28 16:17:55 -04:00
Joey Hess
2bf3addf49 Bugfix: dropunused did not drop keys with two spaces in their name. 2011-11-27 13:50:05 -04:00
Joey Hess
a72f0ecc27 changelog 2011-11-26 12:06:03 -04:00
Joey Hess
12243d2279 Flush json output, avoiding a buffering problem that could result in doubled output.
The bug was that with --json, output lines were sometimes doubled. For
example, git annex init --json would output two lines, despite only running
one thing. Adding to the weirdness, this only occurred when the output
was redirected to a pipe or a file.

Strace showed two processes outputting the same buffered output.
The second process was this writer process (only needed to work around
bug #624389):

                _ <- forkProcess $ do
                        hPutStr toh $ unlines paths
                        hClose toh
                        exitSuccess

The doubled output occurs when this process exits, and ghc flushes the
inherited stdout buffer. Why only when piping? I don't know, but ghc may
be behaving differently when stdout is not a terminal.

While this is quite possibly a ghc bug, there is a nice fix in git-annex.
Explicitly flushing after each chunk of json is output works around the
problem, and as a side effect, json is streamed rather than being output
all at the end when performing an expensive operaition.

However, note that this means all uses of putStr in git-annex must be
explicitly flushed. The others were, already.
2011-11-25 11:51:06 -04:00