From: Jeff King <peff@peff.net>
To: John Keeping <john@keeping.me.uk>
Cc: Jed Brown <jed@59A2.org>,
Charlie Smurthwaite <charlie@atechmedia.com>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, Thomas Rast <trast@inf.ethz.ch>
Subject: Re: Segfault with merge-tree on multiple Git versions
Date: Wed, 27 Mar 2013 16:01:13 -0400 [thread overview]
Message-ID: <20130327200113.GC26380@sigill.intra.peff.net> (raw)
In-Reply-To: <20130327194521.GQ2286@serenity.lan>
On Wed, Mar 27, 2013 at 07:45:21PM +0000, John Keeping wrote:
> On Wed, Mar 27, 2013 at 02:16:24PM -0500, Jed Brown wrote:
> > Charlie Smurthwaite <charlie@atechmedia.com> writes:
> >
> > > Yes, I would need to be able to do this on a bare repo for my use case.
> >
> > And if it's on the server, you don't want this to be observable, so
> > you don't want HEAD to move around. I don't know a better way than:
> >
> > $ git clone --shared -b upstream-branch bare-repo.git /tmp/merge-repo
> > $ cd /tmp/merge-repo
> > $ git pull URL incoming-branch
> >
> > Cloning with --shared just writes a path into .git/objects/info/alternatives
> > and it doesn't need to be on the same file system (unlike --local).
> >
> > Since 'git merge-tree' just works with trees, it has less information
> > than 'git merge'.
>
> You could use a temporary index and do something like:
>
> rm -f TMP_INDEX
> GIT_INDEX_FILE=TMP_INDEX
> export GIT_INDEX_FILE
> git read-tree -m $base $ours $theirs &&
> git merge-index git-merge-one-file -a
>
> then inspect that with "git diff-index --cached $ours".
That is precisely how we do it at GitHub. You probably want to add in
"--aggressive" to your read-tree to cover a few more simple cases. If
there are conflicts, we just bail and say "this can't be merged", and
expect the user to do it themselves using git.
-Peff
next prev parent reply other threads:[~2013-03-27 20:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 15:29 Segfault with merge-tree on multiple Git versions Charlie Smurthwaite
2013-03-27 15:53 ` thomas
2013-03-27 15:58 ` John Keeping
2013-03-27 16:05 ` Thomas Rast
2013-03-27 16:33 ` Junio C Hamano
2013-03-27 17:06 ` Junio C Hamano
2013-03-27 17:17 ` Charlie Smurthwaite
2013-03-27 17:52 ` Charlie Smurthwaite
2013-03-27 18:06 ` Jed Brown
2013-03-27 18:46 ` Charlie Smurthwaite
2013-03-27 19:16 ` Jed Brown
2013-03-27 19:45 ` John Keeping
2013-03-27 20:01 ` Jeff King [this message]
2013-03-27 21:10 ` Charlie Smurthwaite
2013-03-27 20:04 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130327200113.GC26380@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=charlie@atechmedia.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jed@59A2.org \
--cc=john@keeping.me.uk \
--cc=trast@inf.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).