Commit graph

217 commits

Author SHA1 Message Date
Joey Hess
33e6425d10 tweak 2011-05-16 22:49:41 -04:00
Joey Hess
21953a802a am I silly to worry about length overflowing int max? 2011-05-16 22:22:37 -04:00
Joey Hess
5068985020 rejigger what's --fast 2011-05-16 22:19:15 -04:00
Joey Hess
1e3da8efb0 add info about any temp files and bad content files 2011-05-16 22:01:50 -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
Joey Hess
d006586cd0 add a message in potenatially confusing copy --fast failure situation 2011-05-16 13:27:19 -04:00
Joey Hess
93c5fb5da7 support remote config values with spaces and other characters 2011-05-16 13:07:56 -04:00
Joey Hess
ceff04ff3e better multiword parameter handling
This way, individual words as entered on the command line are available
to commands.
2011-05-16 12:25:54 -04:00
Joey Hess
5256a6b011 migrate: Use current filename when generating new key, for backends where the filename affects the key name. 2011-05-16 12:10:08 -04:00
Joey Hess
cad0e1c8b7 simplified a bunch of Maybe handling 2011-05-15 03:38:08 -04:00
Joey Hess
56bc3e95ca refactor some boilerplate 2011-05-15 02:02:46 -04:00
Joey Hess
43f0a666f0 unused: Now also lists files fsck places in .git/annex/bad/ 2011-04-29 13:59:00 -04:00
Joey Hess
76911a446a Avoid using absolute paths when staging location log, as that can confuse git when a remote's path contains a symlink. Closes: #621386
This was a real PITA to fix, since location logs can be staged in
both the current repo, as well as in local remote's repos, in
which case the cwd will not be in the repo. And git add needs different
params in both cases, when absolute paths are not used.

In passing, git annex fsck now stages location log fixes.
2011-04-25 14:54:24 -04:00
Joey Hess
1e84dab4c8 RemoteConfig type 2011-04-15 15:09:36 -04:00
Joey Hess
8ad901a647 refactor 2011-04-09 14:26:32 -04:00
Joey Hess
bc51387e6d Periodically flush git command queue, to avoid boating memory usage too much.
Since the queue is flushed in between subcommand actions being run,
there should be no issues with actions that expect to queue up some stuff
and have it run after they do other stuff. So I didn't have to audit for
such assumptions.
2011-04-07 13:59:31 -04:00
Joey Hess
868300d4c1 unused/dropunused: support --from 2011-04-02 21:35:02 -04:00
Joey Hess
ed7fc4fce9 Bugfix: copy --to --fast never really copied, fixed. 2011-04-01 12:34:06 -04:00
Joey Hess
0a4c610b4f initremote works 2011-03-29 14:55:59 -04:00
Joey Hess
05751d55cd clean up remote.log handling 2011-03-29 14:10:12 -04:00
Joey Hess
b1db436816 started on initremote 2011-03-28 23:22:31 -04:00
Joey Hess
996e5eee01 Merge branch 'master' into s3
Conflicts:
	debian/changelog
2011-03-28 16:34:58 -04:00
Joey Hess
0956f0dd15 fsck: Ensure that files and directories in .git/annex/objects have proper permissions. 2011-03-28 16:19:20 -04:00
Joey Hess
28bf28a73c rename 2011-03-27 19:23:00 -04:00
Joey Hess
4868b64868 Provide a less expensive version of git annex copy --to, enabled via --fast. This assumes that location tracking information is correct, rather than contacting the remote for every file. 2011-03-27 18:34:30 -04:00
Joey Hess
a70035e981 converted move to use Remote
Drop old Remotes.hs, now unused!
2011-03-27 17:24:20 -04:00
Joey Hess
0d83d17f04 convert map to use new code 2011-03-27 17:00:05 -04:00
Joey Hess
30f427700f converted several commands to use Remote
only move and map still to convert
2011-03-27 16:55:43 -04:00
Joey Hess
03fdd0d56e dropunused: Significantly sped up; only read unused log file once. 2011-03-23 23:47:02 -04:00
Joey Hess
6246b807f7 migrate: Support migrating v1 SHA keys to v2 SHA keys with size information that can be used for free space checking. 2011-03-23 17:57:10 -04:00
Joey Hess
ad08273ac5 refactor 2011-03-23 17:29:54 -04:00
Joey Hess
8beb72e206 migrate: Bugfix for case when migrating a file results in a key that is already present in .git/annex/objects.
For example, this could happen if using SHA1 and a file with content
"foo" were added to that backend. Then a file with "content" foo were
migrated from the WORM backend.

Assume that, if a backend assigned the same key, the already annexed
content must be the same. So, the "old" content can be reused.
2011-03-23 17:25:28 -04:00
Joey Hess
3a41923789 clarify wording
temp files are always assumed to be unused, in either mode
2011-03-22 18:53:16 -04:00
Joey Hess
c21998722c fast mode
Add --fast flag, that can enable less expensive, but also less thurough versions of some commands.

* Add --fast flag, that can enable less expensive, but also less thurough
  versions of some commands.
* fsck: In fast mode, avoid checking checksums.
* unused: In fast mode, just show all existing temp files as unused,
  and avoid expensive scan for other unused content.
2011-03-22 17:41:06 -04:00
Joey Hess
aa2d8e33df free space checking
Free space checking is now done, for transfers of data for keys that have free space metadata.
(Notably, not for SHA* keys generated with git-annex 0.24 or earlier.)

The code is believed to work on Linux, FreeBSD, and OSX; check compile-time
messages to see if it is not enabled for your OS.
2011-03-22 17:27:04 -04:00
Joey Hess
c048905dc4 upgrade messages 2011-03-21 20:48:58 -04:00
Joey Hess
6634b6a6b8 imcomplete attempt at supporting lutimes(3) for BSD compat 2011-03-20 14:09:24 -04:00
Joey Hess
140a351fc5 avoid version check before running version and upgrade commands
There are two types of commands; those that access the repository and those
that don't. Sorted.
2011-03-19 18:58:49 -04:00
Joey Hess
54c39d09ba need to explicitly run upgrade now 2011-03-19 18:58:10 -04:00
Joey Hess
6a2a17658c No longer auto-upgrade to repository format 2, to avoid accidental upgrades, etc. Use git-annex upgrade when you're ready to run this version. 2011-03-19 18:33:39 -04:00
Joey Hess
828a84ba33 Add version command to show git-annex version as well as repository version information. 2011-03-19 14:33:24 -04:00
Joey Hess
d7ef5fd294 add explicit upgrade command 2011-03-16 15:48:26 -04:00
Joey Hess
5eb76d2b03 improve upgrade 2011-03-16 11:53:46 -04:00
Joey Hess
49b7f59183 test suite passes again
doesn't test remote functionality.. but that may be working too now
2011-03-15 22:53:14 -04:00
Joey Hess
9d24cc7bdb make commands that take a key as a parameter error if it's bad 2011-03-15 22:46:47 -04:00
Joey Hess
2e1cc2f8b9 fixed dropkey, setkey, and git-annex-shell subcommands
key is now specified as the full key, no --backend needed
2011-03-15 22:42:34 -04:00
Joey Hess
4594bd51c1 rename file 2011-03-15 22:04:50 -04:00
Joey Hess
9d49fe2c17 first pass at using new keys
It compiles. It sorta works. Several subcommands are FIXME marked and
broken, because things that used to accept separate --backend and --key
params need to be changed to accept just a --key that encodes all the key
info, now that there is metadata in keys.
2011-03-15 21:34:13 -04:00
Joey Hess
83a9bb624b fix error throwing 2011-03-15 11:50:40 -04:00
Joey Hess
bc5c54c987 symlink touching fun
When adding files to the annex, the symlinks pointing at the annexed
content are made to have the same mtime as the original file. While git
does not preserve that information, this allows a tool like metastore to be
used with annexed files.
2011-03-14 23:00:23 -04:00
Joey Hess
72d2684016 Rethink filename encoding handling for display. Since filename encoding may or may not match locale settings, any attempt to decode filenames will fail for some files. So instead, do all output in binary mode. 2011-03-12 15:30:17 -04:00
Joey Hess
ef92bd2b0b add copy count 2011-03-05 17:41:36 -04:00
Joey Hess
0de3005c64 whereis: New subcommand to show where a file's content has gotten to. 2011-03-05 17:23:55 -04:00
Joey Hess
6c1607ce66 Support ssh remotes with a port specified. 2011-03-05 15:47:00 -04:00
Joey Hess
aad1372880 move repoConfig out of Remotes 2011-03-05 15:31:46 -04:00
Joey Hess
acde7a1736 improve GitRepos functions for pulling apart URL to repo 2011-03-05 15:13:16 -04:00
Joey Hess
7b2762fb92 better quoting of description via show 2011-03-03 17:22:17 -04:00
Joey Hess
657395b628 add describe subcommand 2011-03-03 17:21:00 -04:00
Joey Hess
b5b78f26ec fix up commands that are trouble on bare repos
Most will just abort. init does a basic init and gives a command to
run elsewhere to finish it.
2011-03-03 16:40:55 -04:00
Joey Hess
b88637fff1 prevent trust commands from trying to do things in a bare repo
Since they need to stage changes, they would actually, if allowed to run,
succeed, but wipe out existing trust.log content.
2011-03-03 16:22:53 -04:00
Joey Hess
9f20aee219 avoid logging to location log when in a bare repo
This assumes that changes to content in bare repos are made from some
non-bare repo, and that the location log is updated on that side.

That's true for move --from and move --to.

It's *not* true for dropkey and setkey and recvkey. But those are plumbing
level commands, so I guess it's ok to assume that someone running those
in a bare repo knows what they're doing. And git-annex-shell is used to
run those, and if the bare repo is non-local, it needs to be able to use
them even though they cannot update the location log. So this seems
unavoidable.
2011-03-03 15:22:53 -04:00
Joey Hess
6206b46e60 fsck: Check for and repair location log damage. 2011-03-02 14:30:36 -04:00
Joey Hess
4cd96ad2db rename 2011-02-28 16:25:31 -04:00
Joey Hess
fcdc4797a9 use ShellParam type
So, I have a type checked safe handling of filenames starting with dashes,
throughout the code.
2011-02-28 16:18:55 -04:00
Joey Hess
836e71297b Support filenames that start with a dash; when such a file is passed to a utility it will be escaped to avoid it being interpreted as an option. 2011-02-25 01:13:01 -04:00
Joey Hess
5a50a7cf13 update unicode FilePath handling
Based on http://hackage.haskell.org/trac/ghc/ticket/3307 ,
whether FilePath contains decoded unicode varies by OS.
So, add a configure check for it.

Also, renamed showFile to filePathToString
2011-02-11 15:37:37 -04:00
Michael Kenney
285fb2bb08 Fixed missing import of Messages module 2011-02-10 21:06:00 -04:00
Joey Hess
fe55b4644e Fix display of unicode filenames.
Internally, the filenames are stored as un-decoded unicode.
I tried decoding them, but then haskell tries to access the wrong files.
Hmm.

So, I've unhappily chosen option "B", which is to decode filenames before
they are displayed.
2011-02-10 14:21:44 -04:00
Joey Hess
35a6506812 unannex: Fix recently introduced bug when attempting to unannex more than one file at a time. 2011-02-09 11:02:21 -04:00
Joey Hess
81e045a539 tweak 2011-02-08 18:26:38 -04:00
Joey Hess
c1b69d1511 fill color for host boxes 2011-02-08 18:17:46 -04:00
Joey Hess
c0ec5a35db show trusted repos in green 2011-02-08 18:04:19 -04:00
Joey Hess
3ae654254d make remotes absolute while spidering 2011-02-08 17:52:32 -04:00
Joey Hess
97d5e23430 map bugfix
Need to find the absolute repo path before looking up the full info for the
repo. Otherwise, it doesn't find the right full info.
2011-02-08 17:46:52 -04:00
Joey Hess
ef2d4f650e fix absrepo data loss
it was dropping the config map for the repos it changed
2011-02-04 01:56:45 -04:00
Joey Hess
926df3d91e node ordering 2011-02-04 00:13:47 -04:00
Joey Hess
0fd0e414ec color unreachable nodes 2011-02-04 00:06:23 -04:00
Joey Hess
67c1facad1 fix infinite loop
Local repos with the same path are not different. :)
2011-02-03 23:23:36 -04:00
Joey Hess
dff47d51e6 cleanup 2011-02-03 23:23:16 -04:00
Joey Hess
1b1a37b7b1 refactor 2011-02-03 22:44:17 -04:00
Joey Hess
17829be0fd map improvements
added uuid.log repos

group repos by host

avoid displaying most urls

display remote names on edges

still some bugs
2011-02-03 22:20:55 -04:00
Joey Hess
0c7d17ae06 new map subcommand, basically working
Still todo:

- add repos from uuid.log that were not directly found
- group repos into their respective hosts
- display inaccessible repos and broken remote connections in red
- anonymize the url display somewhat, so the maps can be shared
- use uuid info to tell when two apparently different repos are actually
  the same repo accessed in different ways
2011-02-03 19:05:15 -04:00
Joey Hess
0e7984a793 add check for unclean tree 2011-02-01 22:02:19 -04:00
Joey Hess
c77ac11acc unannex: Commit staged changes at end
to avoid some confusing behavior with the pre-commit hook, which would see
some types of commits after an unannex as checking in of an unlocked file.
2011-02-01 21:27:23 -04:00
Joey Hess
755029ae0e use forM_ in a few places 2011-01-31 23:27:53 -04:00
Joey Hess
d007e58a54 use mapM_ 2011-01-31 13:52:11 -04:00
Joey Hess
96e561bc47 use Set instead of existence Map
more efficient and idiomatic

I did try using Set.difference, it's still slower than my method.
2011-01-30 01:41:15 -04:00
Joey Hess
c64b50a0ce shutdown no longer a special case 2011-01-29 23:32:32 -04:00
Joey Hess
5584ccc8ad factor out pure code 2011-01-29 23:30:08 -04:00
Joey Hess
e6da7eb177 Improved temp file handling
* Improved temp file handling. Transfers of content can now be resumed
  from temp files later; the resume does not have to be the immediate
  next git-annex run.
* unused: Include partially transferred content in the list.
2011-01-28 14:10:50 -04:00
Joey Hess
04fe906ac6 use safewritefile 2011-01-28 12:35:51 -04:00
Joey Hess
167523f09d better directory handling
Rename Locations functions for better consitency, and make their values
more consistent too.

Used </> rather than manually building paths. There are still more places
that manually do so, but are tricky, due to the behavior of </> when
the second FilePath is absolute. So I only changed places where
it obviously was relative.
2011-01-27 17:00:32 -04:00
Joey Hess
dee9655237 bugfix to move --to
Due to recent changes, the remotes config was not read before the remote
to act on was picked.
2011-01-27 15:45:22 -04:00
Joey Hess
e1d213d6e3 make filename available to fsck messages 2011-01-26 20:37:46 -04:00
Joey Hess
b7903eb2d1 move partitioning out of keyPossibilities
And a bug fix in passing.
2011-01-26 16:44:14 -04:00
Joey Hess
7f6af79232 trust setting improvements 2011-01-26 16:20:28 -04:00
Joey Hess
7b2da21ab7 avoid moving if src and dest are the same 2011-01-26 15:59:10 -04:00
Joey Hess
268cb35e64 implement 3 level trust storage in trust.log 2011-01-26 15:37:16 -04:00
Joey Hess
6a97b10fcb rework config storage
Moved away from a map of flags to storing config directly in the AnnexState
structure. Got rid of most accessor functions in Annex.

This allowed supporting multiple --exclude flags.
2011-01-26 00:17:38 -04:00
Joey Hess
109a719b03 parameterize Backend type
This allows the Backend type to not depend on the Annex type, and
so the Annex type can later be moved out of TypeInternals.
2011-01-25 21:02:34 -04:00