Commit graph

99 commits

Author SHA1 Message Date
Joey Hess
8166facaef Branch handling improvements
Support creating the branch.

Unified branch state into a single data type.

Only commit changes when the index has been changed.
2011-06-22 15:58:30 -04:00
Joey Hess
78a325b093 add a small cache of the most recently accessed item from the git-annex branch
This will speed up typical cases like git-annex get, which currently
has to read the location log once, then read it a second time in order to
add a line to it. Since these reads now involve more than just reading
in a file, it seemed good to add a cache layer.

Only the most recent thing needs to be cached, because git-annex has
good locality; it operates on one file at a time, and only cares
about one item from the branch per file.
2011-06-22 14:18:49 -04:00
Joey Hess
c03af0ed0c code to update a git-annex branch
There is no suitable git hook to run code when pulling changes that
might need to be merged into the git-annex branch. The post-merge hook
is only run when changes are merged into HEAD, and it's possible,
and indeed likely that many pulls will only have changes in git-annex,
but not in HEAD, and not trigger it.

So, git-annex will have to take care to update the branch before reading
from it, to make sure it has merged in current info from remotes. Happily,
this can be done quite inexpensively, just a git-show-ref to list
branches, and a minimalized git-log to see if there are unmerged changes
on the branches. To further speed up, it will be done only once per
git-annex run, max.
2011-06-21 14:33:59 -04:00
Joey Hess
bc731ba6e0 pointless golfing 2011-06-20 21:37:18 -04:00
Joey Hess
703c437bd9 rename modules for data types into Types/ directory 2011-06-01 21:56:04 -04:00
Joey Hess
971ab27e78 better types allowed breaking module dep loop 2011-06-01 19:11:27 -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
cd83541872 --backend now overrides any backend configured in .gitattributes files. 2011-05-18 19:34:46 -04:00
Joey Hess
6aab88fa25 more monadic operator use 2011-05-15 15:27:49 -04:00
Joey Hess
33d23a4ef9 Control.Monad.State import fix for debian stable
It doesn't export `state` there, so hiding it fails. Just list explicitly
what we use.
2011-04-26 19:42:40 -04:00
Joey Hess
43639f69f6 ghc7
* Update Debian build dependencies for ghc 7.
* Debian package is now built with S3 support. Thanks Joachim Breitner for
  making this possible, also thanks Greg Heartsfield for working to improve
  the hS3 library for git-annex.

Also hid a conflicting new symbol from Control.Monad.State
2011-04-21 02:22:40 -04:00
Joey Hess
9fe7e6be70 add cipher field to AnnexState 2011-04-16 16:41:46 -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
6b5918c295 some reorg and further remote generalization 2011-03-27 21:43:25 -04:00
Joey Hess
f30320aa75 add remotes slot to Annex
This required parameterizing the type for Remote, to avoid a cycle.
2011-03-27 16:17:56 -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
bc21502b9a use queue when upgrading, flushing every so often
Added a cheap way to query the size of a queue.

runQueueAt is not the default yet only because there may be some code that
expects to be able to queue some suff, do something else, and run the whole
queue at the end.

10240 is an arbitrary size for the queue. If we assume annexed
filenames are between 10 and 255 characters long, then the queue will
build up between 100kb and 2550kb long commands. The max command line
length on linux is somewhere above 20k, so this is a fairly good balance --
the queue will buffer only a few megabytes of stuff and a minimal number
of commands will be run by xargs.

Also, insert queue items strictly, this should save memory.
2011-03-16 15:10:15 -04:00
Joey Hess
4594bd51c1 rename file 2011-03-15 22:04:50 -04:00
Joey Hess
aad1372880 move repoConfig out of Remotes 2011-03-05 15:31:46 -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
dd0f662849 hello, liftM 2011-02-19 17:00:40 -04:00
Joey Hess
616d1d4a20 rename TypeInternals to BackendTypes
Now that it only contains types used by the backends
2011-01-26 00:37:50 -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
082b022f9a successfully split Annex and AnnexState out of TypeInternals 2011-01-25 21:49:04 -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
Joey Hess
8d6da87eec better types 2011-01-11 18:13:26 -04:00
Joey Hess
eac433a84a use git-annex-shell configlist 2010-12-31 15:46:33 -04:00
Joey Hess
6a5be9d53c rename some stuff and prepare to break out more into Command/* 2010-12-30 14:19:16 -04:00
Joey Hess
c281747b0e add queueRun 2010-11-08 16:40:02 -04:00
Joey Hess
ab4de45491 Add annex.version, which will be used to automate upgrades. 2010-11-08 14:39:12 -04:00
Joey Hess
a3519c365f hlinted a few files 2010-11-06 17:07:11 -04:00
Joey Hess
99c522edef finished adding support for annex.ssh-options 2010-11-01 00:04:53 -04:00
Joey Hess
00d4c7cd01 simplify evals 2010-10-31 23:24:16 -04:00
Joey Hess
1576c48c80 more Wall cleaning 2010-10-31 14:32:18 -04:00
Joey Hess
045b051ec1 got rid of almost all 'return ()' 2010-10-28 12:40:05 -04:00
Joey Hess
833d4b342e copyright statements 2010-10-27 16:53:54 -04:00
Joey Hess
ef26076a5a add git queue to Annex monad
not used anywhere just yet..
2010-10-26 15:59:50 -04:00
Joey Hess
19fde4960d new fromkey subcommand, for registering urls, etc
had to redo Annex monad's flag storage
2010-10-21 16:30:16 -04:00
Joey Hess
f3dcc8489d gratuitous rename 2010-10-18 02:06:27 -04:00
Joey Hess
98676928c8 prune 2010-10-17 12:09:52 -04:00
Joey Hess
b471822cfe move supportedBackends list into annex monad
This was necessary so the File backend could import Backend w/o a cycle.

Moved code that checks whether enough backends have a file into File
backend.
2010-10-17 11:47:36 -04:00
Joey Hess
909f619c07 tweaks 2010-10-16 16:20:49 -04:00
Joey Hess
bbbe9858fe avoid empty commits 2010-10-14 23:52:45 -04:00
Joey Hess
29039fdf97 add flags, and change to subcommand style 2010-10-14 21:10:59 -04:00
Joey Hess
aa2f4bd810 bug 2010-10-14 16:13:43 -04:00
Joey Hess
6f3572e47f more reorg, spiffed up state monad 2010-10-14 03:18:11 -04:00
Joey Hess
4c1d8b9689 more namespace cleanup 2010-10-14 02:41:54 -04:00
Joey Hess
48643b68b3 convert GitRepo to qualified import 2010-10-14 02:36:41 -04:00