git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Segfault with merge-tree on multiple Git versions

From
Charlie Smurthwaite <charlie@atechmedia.com>
Date
Mar 27, 2013, 21:10 UTC
Message-ID
<51536063.50405@atechmedia.com>
In-Reply-To
<20130327200113.GC26380@sigill.intra.peff.net>
On 27/03/13 20:01, Jeff King wrote:
Show 33 quoted lines
> 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

This may be ideal. I will compare it with merge-tree to see which will suit best. Thank you everyone for your help here.

Charlie
Previous: Jeff KingNext: Junio C Hamano
Message 14 of 15 in “Segfault with merge-tree on multiple Git versions”
  1. Charlie SmurthwaiteMar 27, 2013
  2. thomasMar 27, 2013
  3. John KeepingMar 27, 2013
  4. Thomas RastMar 27, 2013
  5. Junio C HamanoMar 27, 2013
  6. Junio C HamanoMar 27, 2013
  7. Charlie SmurthwaiteMar 27, 2013
  8. Charlie SmurthwaiteMar 27, 2013
  9. Jed BrownMar 27, 2013
  10. Charlie SmurthwaiteMar 27, 2013
  11. Jed BrownMar 27, 2013
  12. John KeepingMar 27, 2013
  13. Jeff KingMar 27, 2013
  14. Charlie SmurthwaiteMar 27, 2013
  15. Junio C HamanoMar 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.