From c835166a7cebfa44d232bbed7c5b5e22bdfeb2bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Jun 2011 19:44:45 -0400 Subject: 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. --- doc/todo/branching.mdwn | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc/todo/branching.mdwn') diff --git a/doc/todo/branching.mdwn b/doc/todo/branching.mdwn index 9c44c03fe..37e7b6edd 100644 --- a/doc/todo/branching.mdwn +++ b/doc/todo/branching.mdwn @@ -148,10 +148,8 @@ problem generically. Something like this: * For remotes, there are also `origin/B`, `otherremote/B`, etc. * To merge two branches `B` and `foo/B`, construct a merge commit that makes each file have all lines that were in either version of the file, - with duplicates removed (probably). Do this without checking out a tree, - or using a temporary directory. (One easy but expensive way is to just - check out the branch to a temp dir, union merge into it, and remove the - temp dir ... but it should be possible to do it without using a temp dir.) + with duplicates removed (probably). Do this without checking out a tree. + -- now implemented as git-union-merge * As a `post-merge` hook, merge `*/B` into `B`. This will ensure `B` is always up-to-date after a pull from a remote. * When pushing to a remote, nothing need to be done, except ensure -- cgit v1.2.3