Commit graph

2022 commits

Author SHA1 Message Date
Joey Hess
ad3770e0b2 add merge subcommand 2011-06-22 18:46:56 -04:00
Joey Hess
80302d0b46 improve bare repo handing
Many more commands can work in bare repos now, thanks to the git-annex
branch.
2011-06-22 18:32:41 -04:00
Joey Hess
944c51ba26 improve version checking for v3
Do not set annex.version whenever any command is run. Just do it in init.
This ensures that, if a repo has annex.version=3, it has a git-annex
branch, so we don't have to run a command every time to check for the
branch.

Remove the old ad-hoc logic for v0 and v1, to simplify version checking.
2011-06-22 18:07:45 -04:00
Joey Hess
c7a1690f02 update 2011-06-22 17:56:07 -04:00
Joey Hess
1a182d4d04 stub in v2 upgrade 2011-06-22 17:51:48 -04:00
Joey Hess
c3d96ee38a adjust walkthrough for git-annex branch
don't just pull master.. pull everything
2011-06-22 17:47:55 -04:00
Joey Hess
2035b22a01 better branch display 2011-06-22 17:47:06 -04:00
Joey Hess
b1acf41036 update documentation that mentioned .git-annex/ 2011-06-22 17:26:34 -04:00
Joey Hess
d70e9a945b remove some tests that no longer make sense 2011-06-22 17:15:33 -04:00
Joey Hess
4c4ebf2d75 store trust.log and remote.log in the git-annex branch
.. and I think that's everything that will use the branch
2011-06-22 17:08:51 -04:00
Joey Hess
235e2e63a1 move 2011-06-22 16:30:34 -04:00
Joey Hess
1870186632 fixed logFile 2011-06-22 16:17:16 -04:00
Joey Hess
e0bd9d43a2 update for git-annex branch
stop changing gitattributes on init

create git-annex branch on init

ugly special case for init in a bare repository goes away, yay!

git annex init is also faster, at least in a large existing repo, as
it does not need to run the slow 'git add'
2011-06-22 16:03:26 -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
80274f4c92 use git-annex branch for uuid.log 2011-06-22 16:02:22 -04:00
Joey Hess
ae2be332d4 add runBool 2011-06-22 16:02:07 -04:00
Joey Hess
2e5c8ca6bf use git-annex branch for location log 2011-06-22 16:01:32 -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
17a09fccad commit changes to git-annex branch on shutdown 2011-06-22 16:00:04 -04:00
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
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
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
1cca8b4edb rework core merge code
More likely to be 100% correct now, I think.
2011-06-22 13:59:42 -04:00
Joey Hess
818ae0c6da docs for v3 2011-06-21 20:21:33 -04:00
Joey Hess
7a693394f4 allow for union merges between a tree and the content in the index
This is needed for robust handling of the git-annex branch. Since changes
are staged to its index as git-annex runs, and committed at the end,
it's possible that git-annex is interrupted, and leaves a dirty index.

When it next runs, it needs to be able to merge the git-annex branch
as necessary, without losing the existing changes in the index.

Note that this assumes that the git-annex branch is only modified by
git-annex. Any changes to it will be lost when git-annex updates the
branch. I don't see a good, inexpensive way to find changes in
the git-annex branch that arn't in the index, and union merging the
git-annex branch into the index every time would likewise be expensive.
2011-06-21 20:12:53 -04:00
Joey Hess
5e0adb2637 fixes
make commit commit to the right branch

when getting content from the branch, update first
2011-06-21 19:11:55 -04:00
Joey Hess
5d20ac5800 export the commit function and generalize 2011-06-21 19:09:20 -04:00
Joey Hess
40ec8a9726 Branch module complete
Refactored some code that it needs into GitRepo.
2011-06-21 17:52:39 -04:00
Joey Hess
7e7428f173 refactor 2011-06-21 16:08:09 -04:00
Joey Hess
a5e6802b5b typos in comments 2011-06-21 14:44:56 -04:00
Joey Hess
9a1f0fcee2 start v3 2011-06-21 14:34:08 -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
e735d459b5 moved to library 2011-06-21 14:09:06 -04:00
Joey Hess
9f9e17aa0f unlock: Made atomic. 2011-06-20 22:38:18 -04:00
Joey Hess
53706ad9bf move bug report 2011-06-20 22:29:46 -04:00
Joey Hess
a9a4649148 typo 2011-06-20 22:21:02 -04:00
Joey Hess
8b749d4bfd reorder git-union-merge params 2011-06-20 21:42:17 -04:00
Joey Hess
01e8a0a9e5 allow git-union-merge to write to any ref
Not just refs/heads/* branches.
2011-06-20 21:38:52 -04:00
Joey Hess
d519bc7137 sped up git-union-merge
Avoided the slow git add, instead inject content directly into git and
populate the index all in one pass. Now this runs on my large real-world
repo in 10 seconds, which is acceptable.

Also lots of code cleanups.
2011-06-20 21:37:18 -04:00
Joey Hess
c835166a7c add git-union-merge
This is a new git subcommand, that does a generic union merge operation
between two refs, storing the result in a branch. It operates efficiently
without touching the working tree. It does need to write out a temporary
index file, and may need to write out some other temp files as well.

This could be useful for anything that stores data in a branch,
and needs to merge changes into that branch without actually checking the
branch out. Since conflict handling can't be done without a working copy,
the merge type is always a union merge, which is fine for data stored in
log format (as git-annex does), or in non-conflicting files
(as pristine-tar does).

This probably belongs in git proper, but it will live in git-annex for now.

---

Plan is to move .git-annex/ to a git-annex branch, and use git-union-merge
to handle merging changes when pulling from remotes.

Some preliminary benchmarking using real .git-annex/ data indicates
that it's quite fast, except for the "git add" call, which is as slow
as "git add" tends to be with a big index.
2011-06-20 21:37:18 -04:00
Joey Hess
91e50782ce thought 2011-06-20 21:37:18 -04:00
Joey Hess
2fcb8e3b11 update 2011-06-20 21:37:18 -04:00
Joey Hess
e593a81041 update 2011-06-20 21:37:18 -04:00
Joey Hess
bc731ba6e0 pointless golfing 2011-06-20 21:37:18 -04:00
https://www.google.com/accounts/o8/id?id=AItOawmL8pteP2jbYJUn1M3CbeLDvz2SWAA1wtg
dd4de9deb4 2011-06-20 21:03:00 +00:00
http://joey.kitenet.net/
601b07196e Comment moderation 2011-06-20 17:43:05 +00:00
Joey Hess
64d6520704 git is slow 2011-06-14 19:05:45 -04:00
http://christian.amsuess.com/chrysn
f4609a5d28 minor bug report 2011-06-14 17:01:13 +00:00
Joey Hess
f547277b75 Allow --trust etc to specify a repository by name, for temporarily trusting repositories that are not configured remotes. 2011-06-13 22:19:44 -04:00
Joey Hess
66f5b390fe fix test suite 2011-06-13 21:51:52 -04:00