# Change of a file that has a different name downstream. Downstream was forked from 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
cat > first <<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 backport
cat > first <<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 source1
cat > first <<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 'Yet another change'
git tag source2

git checkout -q downstream
git cherry-pick -x backport > /dev/null
git mv first renamed
git commit -q -m 'Downstream rename'

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

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

diff --git a/renamed b/renamed
index %short..%short 100644
--- a/renamed
+++ b/renamed
@@ -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

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 'Downstream rename 2'
mkdir subdir
git mv another subdir/file
git commit -q -m 'Downstream rename 3'
cat > second <<EOT
Ut enim ad minim veniam,
quis nostrud exercitation
ULLAMCO laboris nisi ut aliquip
ex ea commodo consequat.
EOT
git commit -q -a -m 'Uninteresting downstream change'

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

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

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