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

fatal error when merging a rename

From
AMAnders Melchiorsen <mail@cup.kalibalik.dk>
Date
Apr 20, 2009, 15:36 UTC
Message-ID
<57090.bFoQE3daRhY=.1240241789.squirrel@webmail.hotelhot.dk>
The talk of merge corner cases made me remember this issue:
http://thread.gmane.org/gmane.comp.version-control.git/100859/focus=100956
The merge in the script below fails with this message:
fatal: git write-tree failed to write a tree

which is fixed by the (unapplied) patch from Alex in the thread above, but the worktree is still not updated even with that patch.

Cheers, Anders.

#!/bin/bash
GIT=$(which git)

cd $(mktemp -d am-merge-fail.XXXXXXX) $GIT init

mkdir before yes | head -n100 >before/100 touch after $GIT add before/100 after $GIT commit -minitial

$GIT branch parallel

$GIT rm before/100 after mkdir after yes | head -n99 >after/99 $GIT add after/99 $GIT commit -mmove

$GIT checkout parallel echo "Just to cause a non-ff" >other $GIT add other $GIT commit -mparallel

$GIT merge master
Message 1 of 1 in “fatal error when merging a rename”
  1. Anders MelchiorsenApr 20, 2009

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.