git-annex/Command
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
..
Add.hs Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit. 2013-07-30 19:18:29 -04:00
AddUnused.hs --unused: New switch that makes git-annex operate on all data found by the last run of git annex unused. Supported by fsck, get, move, copy. 2013-07-03 15:26:59 -04:00
AddUrl.hs Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit. 2013-07-30 19:18:29 -04:00
Assistant.hs check in configure if ionice -c3 works 2013-06-21 13:43:04 -04:00
Commit.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
ConfigList.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Content.hs content: New command line way to view and configure a repository's preferred content settings. 2013-05-25 12:44:58 -04:00
Copy.hs --unused: New switch that makes git-annex operate on all data found by the last run of git annex unused. Supported by fsck, get, move, copy. 2013-07-03 15:26:59 -04:00
Dead.hs make dead output consistent with other trust setting commands 2013-06-18 15:41:19 -04:00
Describe.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Direct.hs direct, indirect: Refuse to do anything when the assistant or git-annex watch daemon is running. 2013-04-22 16:41:46 -04:00
Drop.hs drop --auto: Fix bug that prevented dropping files from untrusted repositories. 2013-04-01 15:20:42 -04:00
DropKey.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
DropUnused.hs dropunused behavior change: Now refuses to drop the last copy of a file, unless you use the --force. 2013-07-25 19:50:44 -04:00
EnableRemote.hs To enable an existing special remote, the new enableremote command must be used. The initremote command now is used only to create new special remotes. 2013-04-26 18:22:52 -04:00
Find.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Fix.hs fix: Preserve the original mtime of fixed symlinks. 2013-07-11 11:39:42 -04:00
FromKey.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Fsck.hs --unused: New switch that makes git-annex operate on all data found by the last run of git annex unused. Supported by fsck, get, move, copy. 2013-07-03 15:26:59 -04:00
FuzzTest.hs reduce the amount of subdirectories created by the fuzz tester to saner limit 2013-05-26 16:15:25 -04:00
Get.hs moved AssociatedFile definition 2013-07-04 02:36:02 -04:00
Group.hs content: New command line way to view and configure a repository's preferred content settings. 2013-05-25 12:44:58 -04:00
Help.hs change section 2013-04-20 20:24:57 -04:00
Import.hs Support import in direct mode. 2013-07-22 20:18:00 -04:00
ImportFeed.hs improve comment 2013-07-28 20:15:20 -04:00
InAnnex.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Indirect.hs importfeed: git-annex becomes a podcatcher in 150 LOC 2013-07-28 16:55:42 -04:00
Init.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
InitRemote.hs To enable an existing special remote, the new enableremote command must be used. The initremote command now is used only to create new special remotes. 2013-04-26 18:22:52 -04:00
Lock.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Log.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Map.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Merge.hs merge: Now also merges synced/master or similar branches, which makes it useful to put in a post-receive hook to make a repository automatically update its working copy when git annex sync or the assistant sync with it. 2013-07-03 15:42:56 -04:00
Migrate.hs migrate: Detect if a file gets corrupted while it's being migrated. 2013-05-13 14:27:39 -04:00
Move.hs moved AssociatedFile definition 2013-07-04 02:36:02 -04:00
PreCommit.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
RecvKey.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Reinject.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
ReKey.hs Supports indirect mode on encfs in paranoia mode, and other filesystems that do not support hard links, but do support symlinks and other POSIX filesystem features. 2013-06-10 13:11:33 -04:00
RmUrl.hs rmurl: New command, removes one of the recorded urls for a file. 2013-04-22 17:18:53 -04:00
Semitrust.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
SendKey.hs minor refactoring 2013-03-30 19:05:51 -04:00
Status.hs status: No longer shows dead repositories. 2013-06-17 12:35:33 -04:00
Sync.hs sync: Better support for bare git remotes. Now pushes directly to the master branch on such a remote, instead of to synced/master. This makes it easier to clone from a bare git remote that has been populated with git annex sync or by the assistant. 2013-06-12 14:54:23 -04:00
Test.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
TransferInfo.hs webapp: Progess bar fixes for many types of special remotes. 2013-03-28 17:04:37 -04:00
TransferKey.hs --all for get, move, and copy 2013-07-03 13:55:50 -04:00
TransferKeys.hs moved AssociatedFile definition 2013-07-04 02:36:02 -04:00
Trust.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Unannex.hs Support unannex and uninit in direct mode. 2013-07-22 17:28:53 -04:00
Ungroup.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Uninit.hs Support unannex and uninit in direct mode. 2013-07-22 17:28:53 -04:00
Unlock.hs Use lower case hash directories for storing files on crippled filesystems, same as is already done for bare repositories. 2013-04-04 15:46:33 -04:00
Untrust.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Unused.hs unused: No longer shows as unused tmp files that are actively being transferred. 2013-07-25 19:51:08 -04:00
Upgrade.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
Version.hs include build flags in version info when not in a repo 2013-05-01 23:11:13 -04:00
Vicfg.hs content: New command line way to view and configure a repository's preferred content settings. 2013-05-25 12:44:58 -04:00
Watch.hs webapp: New --listen= option allows running the webapp on one computer and connecting to it from another. 2013-04-08 15:04:35 -04:00
WebApp.hs Android: Make the "Open webapp" menu item open the just created repository when a new repo is made. 2013-06-10 23:55:53 -04:00
Whereis.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00
XMPPGit.hs add section metadata to all commands 2013-03-24 18:28:21 -04:00