# Change of a file that has a different name upstream.
for ((i = 0; i < 10; i++)); do
	echo $i > first
	echo $((10 - i)) > second
	git add first second
	git commit -q -m "Commit $i"
done
git branch downstream
git mv first renamed
git commit -q -m 'Upstream rename'
cat > renamed <<EOT
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
EOT
git commit -q -a -m 'A change'
git tag source1
cat > second <<EOT
Ut enim ad minim veniam,
quis nostrud exercitation
ullamco laboris nisi ut aliquip
ex ea commodo consequat.
EOT
git mv renamed another
git commit -q -a -m 'Upstream rename 2'
mkdir subdir
git mv another subdir/file
git commit -q -m 'Upstream rename 3'
cat > subdir/file <<EOT
Lorem ipsum dolor sit amet,
CONSECTETUR adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
EOT
git commit -q -a -m 'Another change'
git tag source2

git checkout -q downstream
patchpal source1
match <<EOT
commit %sha
Author: A Developer <developer@example.com>
Date:   %date

    A change
    
    commit %sha[source1]
    Author: A Developer <developer@example.com>
    Date:   %date
    
        A change
    
    Conflicts:
    - renamed: different file name: first
    
    (cherry picked from commit %sha[source1])
    Assisted-by: Patchpal
    Signed-off-by: A Developer <developer@example.com>

diff --git a/first b/first
index %short..%short 100644
--- a/first
+++ b/first
@@ -1 +1,4 @@
-9
+Lorem ipsum dolor sit amet,
+consectetur adipiscing elit,
+sed do eiusmod tempor incididunt
+ut labore et dolore magna aliqua.
EOT

patchpal source2
match <<EOT
commit %sha
Author: A Developer <developer@example.com>
Date:   %date

    Another change
    
    commit %sha[source2]
    Author: A Developer <developer@example.com>
    Date:   %date
    
        Another change
    
    Conflicts:
    - subdir/file: different file name: first
    
    (cherry picked from commit %sha[source2])
    Assisted-by: Patchpal
    Signed-off-by: A Developer <developer@example.com>

diff --git a/first b/first
index %short..%short 100644
--- a/first
+++ b/first
@@ -1,4 +1,4 @@
 Lorem ipsum dolor sit amet,
-consectetur adipiscing elit,
+CONSECTETUR adipiscing elit,
 sed do eiusmod tempor incididunt
 ut labore et dolore magna aliqua.
EOT
