From: Thomas Rast Date: Thu, 20 Jun 2013 14:22:02 GMT Subject: Re: [PATCH v2] pull: merge into unborn by fast-forwarding from empty tree Message-ID: <87hags6ewl.fsf@linux-k42r.v.cablecom.net> In-Reply-To: Thomas Rast writes: > if test -z "$orig_head" > then > git update-ref -m "initial pull" HEAD $merge_head "$curr_head" && > - git read-tree -m -u HEAD || exit 1 > + # Two-way merge: we claim the index is based on an empty tree, > + # and try to fast-forward to HEAD. This ensures we will not > + # lose index/worktree changes that the user already made on > + # the unborn branch. > + empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904 > + git read-tree -m -u $empty_tree HEAD || exit 1 > exit > fi I just noticed that I broke the && chaining here, so don't apply this just yet. I'll resend once we settle on the best strategy to generate conflicts (or not). -- Thomas Rast trast@{inf,student}.ethz.ch