#!/bin/bash # A <- create some files # / \ # B C <- cause rename/delete conflicts between B and C # / \ # -> 1 1 <- merge-bases for F and G: B1, C1 # |\ /| # 2 D E 2 # | | | | # | 1 1 | <- overload rename_limit in E1 # | \ / | # | X | # | / \ | # | / \ | # |/ \| # F G <- merge E into B, D into C # \ / # \ / # \ / # H <- recursive merge crashes # # initialize rm -rf crash-test mkdir crash-test cd crash-test git init mkdir data # create a bunch of files n=1 while (( $n <= 1000 )); do echo $n > data/$n; n=$(($n+1)) done # check them in git add data git commit -m A git branch A # remove some files in one branch git checkout -b B A git rm data/99* git add data git commit -m B # few more commits on B echo testB > data/testB git add data git commit -m B1 # with a branch off of it git branch D echo testB2 > data/testB2 git add data git commit -m B2 # put some commits on D git checkout D echo testD > data/testD git add data git commit -m D echo testD1 > data/testD1 git add data git commit -m D1 # back up to the top, create another branch and cause a rename # conflict with the files we deleted earlier git checkout -b C A git rm --cached data/99* rename 's!/9!/moved-9!' data/99* git add data git commit -m C # few more commits on C echo testC > data/testC git add data git commit -m C1 # with a branch off of it git branch E echo testC2 > data/testC2 git add data git commit -m C2 # put a commits on E git checkout E echo testE > data/testE git add data git commit -m E # and now, overload add/delete git rm data/[123456]* n=10000 while (( $n <= 11000 )); do echo $n > data/$n; n=$(($n+1)) done git add data git commit -m E1 # now, merge E into B git checkout B git merge E # force-resolve? git add data git commit -m F git branch F # and merge D into C git checkout C git merge D # force-resolve? git add data git commit -m G git branch G # now, force a recursive merge between F and G git merge F # segfault :(