Commit graph

66 commits

Author SHA1 Message Date
Joey Hess
184a69171d removed another 10 lines via ifM 2012-03-16 01:59:07 -04:00
Joey Hess
146c36ca54 IO exception rework
ghc 7.4 comaplains about use of System.IO.Error to catch exceptions.
Ok, use Control.Exception, with variants specialized to only catch IO
exceptions.
2012-02-03 16:47:24 -04:00
Joey Hess
b81d662cbf Avoid repeated location log commits when a remote is receiving files.
Done by adding a oneshot mode, in which location log changes are written to
the journal, but not committed. Taking advantage of git-annex's existing
ability to recover in this situation.

This is used by git-annex-shell and other places where changes are made to
a remote's location log.
2012-01-28 15:41:52 -04:00
Joey Hess
4a02c2ea62 type alias cleanup 2011-12-31 04:11:58 -04:00
Joey Hess
95d2391f58 more partial function removal
Left a few Prelude.head's in where it was checked not null and too hard to
remove, etc.
2011-12-15 18:19:36 -04:00
Joey Hess
ef28b3fef7 split out Git/Command.hs 2011-12-14 15:56:11 -04:00
Joey Hess
543d0d2501 split out Git/Ref.hs 2011-12-12 18:30:33 -04:00
Joey Hess
d64132a43a hslint 2011-12-09 01:57:13 -04:00
Joey Hess
9290095fc2 improve type signatures with a Ref newtype
In git, a Ref can be a Sha, or a Branch, or a Tag. I added type aliases for
those. Note that this does not prevent mixing up of eg, refs and branches
at the type level. Since git really doesn't care, except rare cases like
git update-ref, or git tag -d, that seems ok for now.

There's also a tree-ish, but let's just use Ref for it. A given Sha or Ref
may or may not be a tree-ish, depending on the object type, so there seems
no point in trying to represent it at the type level.
2011-11-16 02:41:46 -04:00
Joey Hess
637b5feb45 lint 2011-11-11 01:52:58 -04:00
Joey Hess
49d2177d51 factored out some useful error catching methods 2011-11-10 20:57:28 -04:00
Joey Hess
bf460a0a98 reorder repo parameters last
Many functions took the repo as their first parameter. Changing it
consistently to be the last parameter allows doing some useful things with
currying, that reduce boilerplate.

In particular, g <- gitRepo is almost never needed now, instead
use inRepo to run an IO action in the repo, and fromRepo to get
a value from the repo.

This also provides more opportunities to use monadic and applicative
combinators.
2011-11-08 16:27:20 -04:00
Joey Hess
b11a63a860 clean up read/show abuse
Avoid ever using read to parse a non-haskell formatted input string.

show :: Key is arguably still show abuse, but displaying Keys as filenames
is just too useful to give up.
2011-11-08 00:17:54 -04:00
Joey Hess
ad3b462214 sheesh. seriously? 2011-10-29 13:17:37 -04:00
Joey Hess
23f2a12816 broke up Utility 2011-10-16 00:50:12 -04:00
Joey Hess
1a29b5b52e reorganize log modules
no code changes
2011-10-15 16:21:08 -04:00
Joey Hess
6a6ea06cee rename 2011-10-05 16:02:51 -04:00
Joey Hess
cfe21e85e7 rename 2011-10-04 00:59:08 -04:00
Joey Hess
8ef2095fa0 factor out common imports
no code changes
2011-10-03 23:29:48 -04:00
Joey Hess
f77979b8b5 improved git-annex branch changing
All changes to files in the branch are now made via pure functions that
transform the old file into the new. This will allow adding locking
to prevent read/write races. It also makes the code nicer, and purer.

I noticed a behavior change, really a sort of bug fix. Before,
'git annex untrust foo --trust bar' would change both trust levels
permanantly, now the --trust doesn't get stored.
2011-10-03 15:41:25 -04:00
Joey Hess
4bf1a5ef59 refactor 2011-09-23 18:13:24 -04:00
Joey Hess
9f6b7935dd go go gadget hlint 2011-09-20 23:24:48 -04:00
Joey Hess
e296da4bfe more newline fixes
Adds a missing newline when a longnote is followed by a endresult.

Multiple longnotes in a row will now be separated by a blank line, which
could be a bug or a feature depending on taste.

Removed several places where newlines were explicitly displayed after
longnotes.
2011-09-09 01:45:41 -04:00
Joey Hess
678726c10c code simplification thanks to applicative functors 2011-08-25 01:27:19 -04:00
Joey Hess
203148363f split groups of related functions out of Utility 2011-08-22 16:14:12 -04:00
Joey Hess
01cd775d92 Fix broken upgrade from V1 repository. Closes: #638584
Had forgotten to keep several old versions of functions needed during this
upgrade.
2011-08-19 20:32:18 -04:00
Joey Hess
00153eed48 unify elipsis handling
And add a simple dots-based progress display, currently only used in v2
upgrade.
2011-07-19 14:07:23 -04:00
Joey Hess
e784757376 hlint tweaks
Did all sources except Remotes/* and Command/*
2011-07-15 03:12:05 -04:00
Joey Hess
ded2591124 unannex: Clean up use of git commit -a.
This was more complex than would be expected. unannex has to use git commit -a
since it's removing files from git; git commit filelist won't do.

Allow commands to be added to the Git queue that have no associated files,
and run such commands once.
2011-07-14 17:15:37 -04:00
Joey Hess
9f1577f746 remove unused backend machinery
The only remaining vestiage of backends is different types of keys. These
are still called "backends", mostly to avoid needing to change user interface
and configuration. But everything to do with storing keys in different
backends was gone; instead different types of remotes are used.

In the refactoring, lots of code was moved out of odd corners like
Backend.File, to closer to where it's used, like Command.Drop and
Command.Fsck. Quite a lot of dead code was removed. Several data structures
became simpler, which may result in better runtime efficiency. There should
be no user-visible changes.
2011-07-05 19:57:46 -04:00
Joey Hess
d360ca3ed9 make upgrade more robust
don't remove .git-annex until state has been succeffully saved
2011-07-05 15:06:20 -04:00
Joey Hess
79016c197c add hashing to web log files 2011-07-01 17:23:01 -04:00
Joey Hess
f6063a094e renamed GitRepo to Git
It was always imported qualified as Git anyway
2011-06-30 13:21:39 -04:00
Joey Hess
2cda9d0a0f generalized safeWriteFile to viaTmp 2011-06-30 00:46:39 -04:00
Joey Hess
06a1f5f742 factor out file list stuff from GitRepo
GitRepo is getting too large an interface; these all fit nicely into a
submodule.
2011-06-29 11:55:16 -04:00
Joey Hess
d7018500fa fix upgrade when .git-annex has already been entirely converted 2011-06-24 12:09:04 -04:00
Joey Hess
ad38c0dfad better setup of git-annex branch pushing on upgrade 2011-06-24 11:59:34 -04:00
Joey Hess
50354a4916 save state before message
to avoid long delay after
2011-06-24 02:33:44 -04:00
Joey Hess
49d77156ac more upgrades fixes for bare repos 2011-06-24 01:15:12 -04:00
Joey Hess
59b2e4ec1d fixes for upgrading bare repos 2011-06-24 01:13:33 -04:00
Joey Hess
22243b87d2 layout 2011-06-23 17:08:11 -04:00
Joey Hess
068703c405 improve post-upgrade push instructions 2011-06-23 14:51:04 -04:00
Joey Hess
9e37898e21 remove stateDir 2011-06-23 08:48:13 -04:00
Joey Hess
af10b2854a v3 upgrade code works
but write the index file a lot, so slow
2011-06-23 02:30:20 -04:00
Joey Hess
66ceb92702 docs 2011-06-22 23:37:46 -04:00
Joey Hess
1a182d4d04 stub in v2 upgrade 2011-06-22 17:51:48 -04:00
Joey Hess
1870186632 fixed logFile 2011-06-22 16:17:16 -04:00
Joey Hess
5c706d1ec4 stop undoing gitattributes on uninit
v2 upgrade will undo them
2011-06-22 16:03:09 -04:00
Joey Hess
06c58922bd stop changing gitattributes on update from v1
gitattributes changes are not needed, and will be removed in the v2 upgrade
2011-06-22 16:00:32 -04:00
Joey Hess
d3f0106f2e move LocationLog into Annex monad from IO
It will need to run in Annex so it can use Branch
2011-06-22 14:27:50 -04:00