From 91e50782ce6d634ffc8c2f809c80b6d4ff94a5ca Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Jun 2011 15:22:07 -0400 Subject: [PATCH] thought --- doc/todo/branching.mdwn | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/todo/branching.mdwn b/doc/todo/branching.mdwn index 3a7a2d3ca9..9c44c03feb 100644 --- a/doc/todo/branching.mdwn +++ b/doc/todo/branching.mdwn @@ -135,3 +135,25 @@ Problem: Notes are usually attached to git objects, and there are no git objects corresponding to git-annex keys. Problem: Notes are not normally copied when cloning. + +------ + +## elminating the merge problem + +Most of the above options are complicated by the problem of how to merge +changes from remotes. It should be possible to deal with the merge +problem generically. Something like this: + +* We have a local branch `B`. +* 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.) +* 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 + `B` is either successfully pushed, or the push fails (and a pull needs to + be done to get the remote's changes merged into `B`).