Commit graph

943 commits

Author SHA1 Message Date
Joey Hess
65fe2314be fsck: Fix detection and fixing of present direct mode files that are wrongly represented as standin symlinks on crippled filesystems. 2013-09-13 12:50:29 -04:00
Joey Hess
82759b6a5d remotes: New command, displays a compact table of remotes that contain files. (Thanks, anarcat for display code and mastensg for inspiration.)
Note that it would be possible to extend the display to show all
repositories. But there can be a lot of repositories that are not set up as
remotes, and it would significantly clutter the display to show them all.

Since we're not showing all repositories, it's not worth trying to show
numcopies count either.

I decided to embrace these limitations and call the command remotes.
2013-09-12 12:21:21 -04:00
Joey Hess
b64f5baf2d sync: support gcrypt 2013-09-09 10:02:15 -04:00
Joey Hess
ecbb326e9d Allow building without quvi support. 2013-09-09 02:16:22 -04:00
Joey Hess
7c1a9cdeb9 partially complete gcrypt remote (local send done; rest not)
This is a git-remote-gcrypt encrypted special remote. Only sending files
in to the remote works, and only for local repositories.

Most of the work so far has involved making initremote work. A particular
problem is that remote setup in this case needs to generate its own uuid,
derivied from the gcrypt-id. That required some larger changes in the code
to support.

For ssh remotes, this will probably just reuse Remote.Rsync's code, so
should be easy enough. And for downloading from a web remote, I will need
to factor out the part of Remote.Git that does that.

One particular thing that will need work is supporting hot-swapping a local
gcrypt remote. I think it needs to store the gcrypt-id in the git config of the
local remote, so that it can check it every time, and compare with the
cached annex-uuid for the remote. If there is a mismatch, it can change
both the cached annex-uuid and the gcrypt-id. That should work, and I laid
some groundwork for it by already reading the remote's config when it's
local. (Also needed for other reasons.)

This commit was sponsored by Daniel Callahan.
2013-09-07 18:38:00 -04:00
Joey Hess
4079f9cfe8 avoid double commit during transition
The second commit had some bad refs which resulted in the race detection
code running. But that commit was unnecessary anyway, it only was there to
merge in the other refs.
2013-09-03 16:33:15 -04:00
Joey Hess
b51dffa46d fix error propigating when unable to download feed item 2013-09-03 14:39:07 -04:00
Joey Hess
db83cc82d6 Merge branch 'forget'
Conflicts:
	debian/changelog
2013-09-03 14:36:00 -04:00
Joey Hess
d1bacccff4 importfeed: Also ignore transient problems with downloading content from feeds. 2013-09-03 14:32:26 -04:00
Joey Hess
0831e18372 forget --drop-dead: Completely removes mentions of repositories that have been marked as dead from the git-annex branch.
Wrote nice pure transition calculator, and ugly code to stage its results
into the git-annex branch. Also had to split up several Log modules
that Annex.Branch needed to use, but that themselves used Annex.Branch.

The transition calculator is limited to looking at and changing one file at
a time. While this made the implementation relatively easy, it precludes
transitions that do stuff like deleting old url log files for keys that are
being removed because they are no longer present anywhere.
2013-08-31 17:51:13 -04:00
Joey Hess
62beaa1a86 refactor git-annex branch log filename code into central location
Having one module that knows about all the filenames used on the branch
allows working back from an arbitrary filename to enough information about
it to implement dropping dead remotes and doing other log file compacting
as part of a forget transition.
2013-08-29 19:13:00 -04:00
Joey Hess
6cdac3a003 sync, assistant: Force push of the git-annex branch.
Necessary to ensure it gets pushed to remotes after being rewritten by forget.
See inline rationalles for why I think this is safe!
2013-08-29 14:27:53 -04:00
Joey Hess
4a915cd3cd add forget command
Works, more or less. --dead is not implemented, and so far a new branch
is made, but keys no longer present anywhere are not scrubbed.

git annex sync fails to push the synced/git-annex branch after a forget,
because it's not a fast-forward of the existing synced branch. Could be
fixed by making git-annex sync use assistant-style sync branches.
2013-08-28 16:41:13 -04:00
guilhem
f754779c02 Unused: bugfix
Detect staged files that are not in the working tree.
2013-08-26 13:50:09 -04:00
Joey Hess
88e2618e38 fix reversion in unused
The reversion was that, if a file was git rm'd, but still in branches, it
would not be seen as used. Looking at both the added and the removed (or
changed) files from the diff-index is a cheap way to fix that.
2013-08-26 00:19:19 -04:00
Joey Hess
36f5b10065 whitespace 2013-08-25 21:41:10 -04:00
Joey Hess
0963f92984 unnecessary do block 2013-08-25 21:38:01 -04:00
guilhem
f15fda60ed Speed up the 'unused' command.
Instead of populating the second-level Bloom filter with every key
referenced in every Git reference, consider only those which differ
from what's referenced in the index.

Incidentaly, unlike with its old behavior, staged
modifications/deletion/... will now be detected by 'unused'.

Credits to joeyh for the algorithm. :-)
2013-08-25 21:02:13 -04:00
Joey Hess
824241b6fb better cases 2013-08-22 23:44:13 -04:00
Joey Hess
46b6d75274 Youtube support! (And 53 other video hosts)
When quvi is installed, git-annex addurl automatically uses it to detect
when an page is a video, and downloads the video file.

web special remote: Also support using quvi, for getting files,
or checking if files exist in the web.

This commit was sponsored by Mark Hepburn. Thanks!
2013-08-22 18:50:43 -04:00
Joey Hess
6fd2935a5a unused: Pay attention to symlinks that are not yet staged in the index. 2013-08-22 10:20:03 -04:00
Joey Hess
0f921307e7 mirror: New command, makes two repositories contain the same set of files.
This is a simple approach for setting up a mirroring repository.

It will work with any type of remotes.

Mirror --from is more expensive than mirror --to in general.
OTOH, mirror --from will get the file from any remote that has it, not only
the named mirror remote. And if the named mirror remote is not the fastest
available remote with a file, that can speed things up.

It would be possible to make the assistant or watch command do a more
dynamic mirroring, that didn't need to scan every time.
2013-08-20 15:46:35 -04:00
Joey Hess
b46afa29ac implement import --deduplicate and import --clean-duplicates
Note that --deduplicate currently checksums each file twice,
once to see if it's a known key, and once when importing it.

Perhaps this could be revisited and the extra checksum gotten rid of,
at the cost of not locking down the file when adding it.
2013-08-20 11:00:52 -04:00
Joey Hess
e240cb99f7 Merge branch 'duplicate'
Conflicts:
	debian/changelog
2013-08-20 10:27:24 -04:00
Joey Hess
a6a047192e sync, merge: Bug fix: Don't try to merge into master when in a bare repo. 2013-08-17 21:29:44 +02:00
Joey Hess
d69da2bf22 implement import --duplicate
The other two options are harder, due to needing to get the key for a file
before adding it.
2013-08-11 20:31:54 +02:00
Joey Hess
b28023cb52 importfeed: Fix handling of dots in extensions. 2013-08-03 02:36:38 -04:00
Joey Hess
24c8a6042b importfeed: Ignores transient problems with feeds. Only exits nonzero when a feed has repeatedly had a problems for at least 1 day. 2013-08-03 01:40:21 -04:00
Joey Hess
dc3e0725f9 improve error message 2013-08-02 13:01:25 -04:00
Joey Hess
93f2371e09 get rid of __WINDOWS__, use mingw32_HOST_OS
The latter is harder for me to remember, but avoids build failures in code
used by the configure program.
2013-08-02 12:27:32 -04:00
Joey Hess
03c76b5a30 improve importfeed --force; try to match existing files to avoid unncessary duplication 2013-08-01 11:57:05 -04:00
Joey Hess
42ca8aaa61 importfeed --force: re-download urls that have been seen before 2013-07-31 12:19:00 -04:00
Joey Hess
9476355bc3 find: Avoid polluting stdout with progress messages. Closes: #718186 2013-07-30 20:24:27 -04:00
Joey Hess
ddd46db09a Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit.
Started with a problem when running addurl on a really long url,
because the whole url is munged into the filename. Ended up doing
a fairly extensive review for places where filenames could get too large,
although it's hard to say I'm not missed any..

Backend.Url had a 128 character limit, which is fine when the limit is 255,
but not if it's a lot shorter on some systems. So check the pathconf()
limit. Note that this could result in fromUrl creating different keys
for the same url, if run on systems with different limits. I don't see
this is likely to cause any problems. That can already happen when using
addurl --fast, or if the content of an url changes.

Both Command.AddUrl and Backend.Url assumed that urls don't contain a
lot of multi-byte unicode, and would fail to truncate an url that did
properly.

A few places use a filename as the template to make a temp file.
While that's nice in that the temp file name can be easily related back to
the original filename, it could lead to `git annex add` failing to add a
filename that was at or close to the maximum length.

Note that in Command.Add.lockdown, the template is still derived from the
filename, just with enough space left to turn it into a temp file.
This is an important optimisation, because the assistant may lock down
a bunch of files all at once, and using the same template for all of them
would cause openTempFile to iterate through the same set of names,
looking for an unused temp file. I'm not very happy with the relatedTemplate
hack, but it avoids that slowdown.

Backend.WORM does not limit the filename stored in the key.
I have not tried to change that; so git annex add will fail on really long
filenames when using the WORM backend. It seems better to preserve the
invariant that a WORM key always contains the complete filename, since
the filename is the only unique material in the key, other than mtime and
size. Since nobody has complained about add failing (I think I saw it
once?) on WORM, probably it's ok, or nobody but me uses it.

There may be compatability problems if using git annex addurl --fast
or the WORM backend on a system with the 255 limit and then trying to use
that repo in a system with a smaller limit. I have not tried to deal with
those.

This commit was sponsored by Alexander Brem. Thanks!
2013-07-30 19:18:29 -04:00
Joey Hess
07a9910af7 improve comment 2013-07-28 20:15:20 -04:00
Joey Hess
ac08924ec3 fix bug in makeUnique
Returned the possibly non-unique file
2013-07-28 20:14:13 -04:00
Joey Hess
8c55970413 better extension handling
When there's no extension, don't use "none", but "".

When there is an extension, it starts with a dot, so don't put a redundant
dot in the default format.
2013-07-28 19:08:50 -04:00
Joey Hess
8c8488e01a if a feed cannot be downloaded or has no enclosures, fail 2013-07-28 18:16:24 -04:00
Joey Hess
18541bf3fa don't crash on encoding issues in feeds
filesystem encoding to the rescue once more!

IIRC this was the main bug in hpodder.
2013-07-28 17:24:30 -04:00
Joey Hess
66dfeaff44 show a side action when finding known urls 2013-07-28 17:19:21 -04:00
Joey Hess
7e66d260ea importfeed: git-annex becomes a podcatcher in 150 LOC 2013-07-28 16:55:42 -04:00
Joey Hess
c6100aa5cc unused: No longer shows as unused tmp files that are actively being transferred. 2013-07-25 19:51:08 -04:00
Joey Hess
822918089e dropunused behavior change: Now refuses to drop the last copy of a file, unless you use the --force.
This was the last place in git-annex that could remove data referred to by
the git history, without being forced.

Like drop, dropunused checks remotes, and honors the global annex.numcopies
setting. (However, .gitattributes settings cannot apply to unused files.)
2013-07-25 19:50:44 -04:00
Joey Hess
5e3a404d4f Support import in direct mode. 2013-07-22 20:18:00 -04:00
Joey Hess
f353f13c9d Support unannex and uninit in direct mode.
In direct mode, it's best to whenever possible not move direct mode files
out of the way, and so I made unannex avoid touching the direct mode file at
all.

That actually turns out to be easy, because in direct mode, unlike indirect
mode, the pre-commit hook won't get confused if the unannexed file later
gets added back by git add. So there's no need to commit the unannex right
away; it can be staged for the user to commit later. This also means that
unannex in direct mode is a lot faster than in indirect mode!

Another subtle bit is the bookkeeping that is done when unannexing a direct
mode file. The inode cache needs to be removed so that when uninit runs
getKeysPresent, it doesn't see the cache and think the key is still
present and crash when it's not.

This commit is sponsored by Douglas Butts. Thanks!
2013-07-22 17:28:53 -04:00
Joey Hess
3e422cb5fa fix uninit to delete content from annex when it ended up hard linked back to the work tree 2013-07-18 13:30:12 -04:00
Joey Hess
1d7d3ac325 uninit: Preserve .git/annex/objects at the end, if it still has content, so that old versions of files and deleted files are not deleted. Print a message with some suggested actions. 2013-07-16 15:00:25 -04:00
Joey Hess
c936384164 fix: Preserve the original mtime of fixed symlinks. 2013-07-11 11:39:42 -04:00
Joey Hess
207c9f3c4a dropunused, addunused: Complain when asked to operate on a number that does not correspond to any unused key. 2013-07-08 16:47:34 -04:00
Joey Hess
74ad3072e4 addurl --pathdepth: Fix failure when the pathdepth specified is deeper than the urls's path. 2013-07-05 12:46:38 -04:00