Commit graph

89 commits

Author SHA1 Message Date
Joey Hess
60ab3d84e1 added ifM and nuked 11 lines of code
no behavior changes
2012-03-14 17:43:34 -04:00
Joey Hess
997e29f294 sync: Sync to lower cost remotes first.
This has two benefits.

1. When a lot of refs are going to be received, get them via lower cost
   connection when possible.
2. Allows ctrl-c of sync after the cheaper remotes have been pulled from
   (or pushed to).
2012-03-10 15:37:38 -04:00
Joey Hess
1f73db3469 improve alwayscommit=false mode
Now changes are staged into the branch's index, but not committed,
which avoids growing a large journal. And sync and merge always
explicitly commit, ensuring that even when they do nothing else,
they commit the staged changes.

Added a flag file to indicate that the branch's journal contains
uncommitted changes. (Could use git ls-files, but don't want to run
that every time.)

In the future, this ability to have uncommitted changes staged in the
journal might be used on remotes after a series of oneshot commands.
2012-02-25 16:18:55 -04:00
Joey Hess
a1e52f0ce5 hlint 2012-02-16 00:44:51 -04:00
Joey Hess
df21cbfdd2 look up --to and --from remote names only once
This will speed up commands like move and drop.
2012-01-06 04:06:13 -04:00
Joey Hess
508b427c7b tweak 2012-01-02 11:57:02 -04:00
Joey Hess
f0957426c5 skip local remotes that are not available (ie, not mounted)
With --fast, unavailable local remotes are filtered out of the fast set.
This way, if there are local remotes, --fast always acts only on them,
and if none are mounted, acts on nothing. This consistency is better
than --fast acting on different remotes depending on what's mounted.
2011-12-31 04:50:39 -04:00
Joey Hess
4a02c2ea62 type alias cleanup 2011-12-31 04:11:58 -04:00
Joey Hess
a2ec2d3760 refactor and check for a detached HEAD 2011-12-31 03:38:58 -04:00
Joey Hess
8a33573caf better filtering out of special remotes 2011-12-31 03:27:37 -04:00
Joey Hess
6cd4c7efcd never pick special remotes in --fast
even if they have the lowest cost, we cannot use them
2011-12-31 03:14:05 -04:00
Joey Hess
c61642ef0c remove unnecessary check
mergeLocal always creates the local sync branch, so no need to check that
it exists later.
2011-12-31 03:08:44 -04:00
Joey Hess
aa64b8ceaf refactor 2011-12-31 03:01:18 -04:00
Joey Hess
2998340abb really fix check that remote needs merged 2011-12-31 02:45:12 -04:00
Joey Hess
9a7a77488e tweak 2011-12-31 02:18:16 -04:00
Joey Hess
0396f9c795 tweak 2011-12-31 02:15:13 -04:00
Joey Hess
f2b584ad74 fix check that remote branch needs merged 2011-12-31 02:03:39 -04:00
Joey Hess
79231bcff0 minor cleanups
mergeFrom is never called on branches that don't exist anymore
2011-12-31 01:51:39 -04:00
Joey Hess
015a497914 avoid syncing remotes configured annex-ignore, unless explicitly specified 2011-12-31 01:42:42 -04:00
Joey Hess
e7d3e546c2 sync --fast: Selects some of the remotes with the lowest annex.cost and syncs those, in addition to any specified at the command line. 2011-12-30 21:17:36 -04:00
Joey Hess
a31b7d93c8 push when git-annex branch changed
I was too heavy-handed in optimising away pushes
2011-12-30 19:38:46 -04:00
Joey Hess
79872e360e automated syncing
Some changes to make automated syncing nicer. Merge from both the remote's
$branch and its synced/$branch; either could have new changes. Create
synced/$branch on the remote when pushing.
2011-12-30 19:24:57 -04:00
Joey Hess
f6f7ee7131 automatically create the syncbranch 2011-12-30 18:52:24 -04:00
Joey Hess
14d16b77b3 refactor 2011-12-30 18:37:55 -04:00
Joey Hess
52104dae6f refactor 2011-12-30 18:36:40 -04:00
Joey Hess
56488e807b check that synced/master exists before trying to use it
and a nice error message if syncing is not set up yet
2011-12-30 18:19:45 -04:00
Joey Hess
f2fa29bf3b check if branches are up-to-date before merging, pushing
This optimises away the need to run anything in some common cases.
It's particularly useful on push; no need to push if the tracking branch
we just pulled is the same as the branch we're going to push.
2011-12-30 18:04:01 -04:00
Joey Hess
9d85baa314 improve wording 2011-12-30 17:54:09 -04:00
Joey Hess
4400f65967 message cleanup 2011-12-30 17:38:38 -04:00
Joey Hess
556618a3ec avoid using Git.Ref.describe except for when generating user messages
The other uses of it can all be simplified using Git.Ref.base,
Git.Ref.under, and show.

In some cases, describe was being used to shorten the branch name
unnecessarily, and I instead pass the fully qualified name to git.
2011-12-30 17:01:03 -04:00
Joey Hess
5d17da5eb3 update to my indentation style 2011-12-30 16:24:30 -04:00
Joey Hess
5728bb58e0 force git-annex branch update after fetching remotes
git-annex normally only runs the branch update once per run, for speed, but
since this fetches new remote git-annex tracking branches, they need to be
merged in after that fetch. An earlier call to Remote.byName was causing
the update to run before the fetch sometimes, but it could have been
anything. Just force the update to happen in the right place.
2011-12-30 16:03:41 -04:00
Joachim Breitner
b6e7b40be4 By default, sync with all remotes having the synced/ branch 2011-12-29 20:50:57 +01:00
Joachim Breitner
0ee1141f30 Implement branch-syncing in Command.Sync
as described in the previous commit to the documentation. The loggin UI
is not great yet.
2011-12-29 18:37:30 +01: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
13fff71f20 split out three modules from Git
Constructors and configuration make sense in separate modules.
A separate Git.Types is needed to avoid cycles.
2011-12-13 15:06:49 -04:00
Joey Hess
4200b8038a separate operations 2011-12-10 12:21:22 -04:00
Joey Hess
fb8231f3a1 sync: New command that synchronises the local repository and default remote, by running git commit, pull, and push for you. 2011-12-09 20:27:22 -04:00