Commit graph

94 commits

Author SHA1 Message Date
Joey Hess
3b97c09cde
better avoid switching to direct mode in clone of adjusted branch repo 2016-06-02 16:10:30 -04:00
Joey Hess
72f0d3d384
Automatically enable v6 mode when initializing in a clone from a repo that has an adjusted branch checked out.
The clone also has the adjusted branch checked out, so it needs to be
initialized to a version that supports that.
2016-06-02 15:34:30 -04:00
Joey Hess
80b86ff78d
fix recent test suite reversion
git annex adjust --force will overwrite any current adjusted branch.
I didn't document this because for the user, deleting the branch is just as
good.
2016-05-23 11:23:30 -04:00
Joey Hess
eda5d9cc74
adjust: Add --fix adjustment, which is useful when the git directory is in a nonstandard place. 2016-05-16 17:18:33 -04:00
Joey Hess
9f05be393e
adjust: If the adjusted branch already exists, avoid overwriting it, since it might contain changes that have not yet been propigated to the original branch.
Could not think of a foolproof way to detect if the old adjusted branch was
just behind the current branch. It's possible that the user amended the
adjusting commit at the head of the adjusted branch, for example.

I decided to bail in this situation, instead of just entering the old
branch, so that if git annex adjust succeeds the user is always in a
*current* adjusted branch, not some old and out of date one.

What could perhaps be done is enter the old branch and then update it. But
that seems too magical; the user may have rebased master or something or
may not want to propigate the changes from the old branch. Best to error
out.
2016-05-13 14:04:22 -04:00
Joey Hess
a9e8cf42d6
more windows path fixes
normalize filepaths in the map because it may be constructed with
windows-style paths and then queried for git-style
2016-05-04 13:00:02 -04:00
Joey Hess
46e3319995
assistant: Deal with upcoming git's refusal to merge unrelated histories by default
git 2.8.1 (or perhaps 2.9.0) is going to prevent git merge from merging in
unrelated branches. Since the webapp's pairing etc features often combine
together repositories with unrelated histories, work around this behavior
change by setting GIT_MERGE_ALLOW_UNRELATED_HISTORIES when the assistant
merges.

Note though that this is not done for git annex sync's merges, so
it will follow git's default or configured behavior.
2016-04-22 14:26:44 -04:00
Joey Hess
0273cd5005
adjusted branches need git 2.2.0 or newer
When git-annex is used with a git version older than 2.2.0, disable support for
adjusted branches, since GIT_COMMON_DIR is needed to update them and was first
added in that version of git.
2016-04-22 12:29:32 -04:00
Joey Hess
5e190913a4
add AdjBranch newtype; some simplications 2016-04-09 15:10:26 -04:00
Joey Hess
b5be04027c
change name of basis branch
Making the name look too much like the adjusted branch was ambiguous.
2016-04-09 14:17:20 -04:00
Joey Hess
7d28110c68
fix master push overwrite race when updating adjusted branch, by maintaining basis ref 2016-04-09 14:12:25 -04:00
Joey Hess
6549049142
fix commit tree after merge into adjusted branch 2016-04-06 19:22:15 -04:00
Joey Hess
887ef93a7f
run out of tree merge with --no-ff
This is how direct mode does it too, and somehow, for reasons that
currently escape me, this makes git merge not care if it's run with an
empty work tree.
2016-04-06 18:40:28 -04:00
Joey Hess
60bdffe43e
fix auto merge conflict resolution when doing out of tree merge for adjusted branch 2016-04-06 17:32:04 -04:00
Joey Hess
b9e4e2ba84
new method for merging changes into adjusted branch that avoids unncessary merge conflicts
Still needs work when there are actual merge conflicts.
2016-04-06 15:36:18 -04:00
Joey Hess
f78cbd9f0d
todo 2016-04-04 14:38:29 -04:00
Joey Hess
7c7f3a0f76
deal with cloning a repo that has an ajdusted branch checked out 2016-04-04 13:51:42 -04:00
Joey Hess
7ba836eec3
make way for git checkout output 2016-04-04 13:25:30 -04:00
Joey Hess
c3e0859846
Upgrading a direct mode repository to v6 has changed to enter an adjusted unlocked branch.
This makes the direct mode to v6 upgrade able to be performed in one clone
of a repository without affecting other clones, which can continue using v5
and direct mode.
2016-04-04 13:17:24 -04:00
Joey Hess
12ddb6e8b2
fixed merging of changes from adjusted branch + a remote 2016-03-31 18:54:35 -04:00
Joey Hess
860602a1e6
made some progress on syncing adjusted branches, but still buggy 2016-03-31 14:56:10 -04:00
Joey Hess
a585731935
add reflog messages 2016-03-31 12:27:48 -04:00
Joey Hess
02ce75c87d
clean up handling of commit lock
Closing the lock manually caused a later exception when the bracket tried
to close it again.
2016-03-31 12:04:05 -04:00
Joey Hess
8a69298bf2
init: Automatically enter the adjusted unlocked branch when in a v6 repo on a filesystem not supporting symlinks. 2016-03-29 13:54:42 -04:00
Joey Hess
42b7ccc89f
git annex add in adjusted unlocked branch
Cached the current branch lookup just because it seems unnecessary overhead
to run an extra git command per add to query the current branch.
2016-03-29 13:26:06 -04:00
Joey Hess
1df62b43d1
remove hashPointerFile'
no longer needed now that hashPointerFile uses a long-running git
hash-object handle
2016-03-29 11:15:21 -04:00
Joey Hess
41b7c5f6aa
implement another adjustment -- easy to do now! 2016-03-11 19:54:10 -04:00
Joey Hess
a85196bd4e
simplify adjustment reversal 2016-03-11 19:41:11 -04:00
Joey Hess
ba1ef156a2
fix deletion of files in adjustTree 2016-03-11 16:30:06 -04:00
Joey Hess
b9184f69a7
improve propigation of commits from adjusted branches
Only reverse adjust the changes in the commit, which means that adjustments
do not need to be generally cleanly reversable.

For example, an adjustment can unlock all locked files, but does not need
to worry about files that were originally unlocked when reversing, because
it will only ever be run on files that have been changed. So, it's ok
if it locks all files when reversed, or even leaves all files as-is when
reversed.
2016-03-11 16:05:06 -04:00
Joey Hess
5e3f707c34
rebase on top of updated original branch 2016-03-03 17:00:48 -04:00
Joey Hess
ac08f6580e
fix abs filepath generation 2016-03-03 16:47:51 -04:00
Joey Hess
40509e20e5
change name of adjusted branches to eg adjusted/master(unlocked)
Using adjusted/unlocked/master made lots of git stuff dealing with "master"
complain that it was ambiguous. This new appoach is more like view branch
names, and shows the adjustment right there in the branch display even if
only the basename of the branch is shown.
2016-03-03 16:38:56 -04:00
Joey Hess
cf24e9b892
working toward adjusted commit propigation 2016-03-03 16:19:09 -04:00
Joey Hess
91f37673df
can't checkout adjusted branch while index is still locked
There's a race here, but entering an adjusted branch for the first time is
not something to do when a commit is being made at the same time. Although,
may want to prevent the assistant from committing while entering the
adjusted branch.
2016-03-03 14:20:39 -04:00
Joey Hess
6024108ab2
push original branch, not adjusted branch 2016-03-03 14:13:54 -04:00
Joey Hess
ef1abda78b
lock index while making index-less commits
Avoids race with another git commit at the same time adjusted branch is
being updated.
2016-03-03 12:55:00 -04:00
Joey Hess
a97a9aaaee
remove debug 2016-02-29 17:36:20 -04:00
Joey Hess
70e78cc53e
update keys database when adjusting branches 2016-02-29 17:27:19 -04:00
Joey Hess
d7bd4d971d
implement updateAdjustedBranch 2016-02-29 17:16:56 -04:00
Joey Hess
048d513233
make assistant aware of adjusted branches when merging 2016-02-29 15:57:47 -04:00
Joey Hess
7c20bf6e7a
make sync aware of adjusted branches
So, it will pull and push the original branch, not the adjusted one.

And, for merging, it will use updateAdjustedBranch (not implemented yet).

Note that remaining uses of Git.Branch.current need to be checked too;
for things that should act on the original branch, and not the adjusted
branch.
2016-02-29 15:23:08 -04:00
Joey Hess
9e1ebc2336
include adjustment in the adjusted branch name
Allows it to be recovered easily.
2016-02-29 15:04:58 -04:00
Joey Hess
0a1b02ce04
adjusted branches, proof of concept
"git annex adjust" may be a temporary interface, but works for a proof of
concept.

It is pretty fast at creating the adjusted branch. The main overhead is
injecting pointer files. It might be worth optimising that by reusing the
symlink target as the pointer file content. When I tried to do that,
the problem was that the clean filter doesn't use that same format, and so
git thought files had changed. Could be dealt with, perhaps make the clean
filter use symlink format for pointer files when on an adjusted branch?

But the real overhead is in checking out the branch, when git runs the
smudge filter once per file. That is perhaps too slow to be usable,
although it may only affect initial checkout of the branch, and not
updates. TBD.
2016-02-25 16:23:24 -04:00