#!/bin/sh

mkdir gittc
cd gittc

# Create repo
git init

# Create the old file
echo "Old line" > file1
git add file1
git commit -m file1

# Branch
git checkout -b foo

# Do an ugly move and change
git rm file1
echo "New line ...\n... and more" > file2
git add file2
git commit -m "Ugly"

# Back to master and change something
git checkout master
echo "\n\n\n\n\n\n\n\n\n\nbla" >> file1
git commit -a -m file1

# Back to foo and merge master
git checkout foo
git merge master
echo "New line ...\n ... and more\n\n\n\n\n\n\nbla\nEven more" > file2
git rm file1
git commit -a -m merged

# Back to master and change file1 again
git checkout master
sed -i 's/bla/foo/' file1
git commit -a -m replace


# Try to merge into foo again, and blame
git checkout foo
git merge master
git blame file2 ### DIE

