How does git-debcherry cope with the overlapping changes when generating
debian/patches? What can you do if it fails to linearise the changes
(as, apparently, it may sometimes do)?
Just did some fiddling.
I have no idea if this is the git-debcherry I should be using or not, so far it is the only copy I have found: git://pivot.cs.unb.ca/gitpkg.git
I created a script that generates a some commits on different feature branches, with a deliberate conflict.
Unexpectedly, this means there is only one patch generating with both feature branches included. However the results appear to be technically correct.
My random thought: I like being able to predict what will happen to patches in git-dpm. For example, if I supply the git-debcherry produced patch file name, when upstream get around to looking at it, that patch may no longer exist because I (accidentally?) created a newer patch that conflicts.
Not sure if there is an easy way to tell if two feature branches conflict or not. This might be me and/or something that can be fixed in git-debcherry though.
Regardless, if you need to make a sequence of changes, say to one file, git-dpm would appear to be the better choice, I think.
Note the script does a "rm -rf a", so don't do this on anything important. git-debcherry location is also hard coded.
=== cut ===
#!/bin/sh
set -ex
rm -rf a
mkdir a
cd a
git init
touch readme.txt
git add readme.txt
git commit -m "upstream"
git branch upstream
# feature a version 1
git checkout -b feature_a upstream
echo "My line 1" > readme.txt
echo "My line 1" > readme0.txt
git add readme.txt readme0.txt
git commit -m "feature a version 1"
# feature b version 1
git checkout -b feature_b upstream
echo "My line 2" > readme2.txt
git add readme2.txt
git commit -m "feature b version 1"
# merge feature a and feature b into debian
git checkout -b debian upstream
git merge feature_a -m "merge feature a"
git merge feature_b -m "merge feature b"
# modify feature a
git checkout feature_a
echo "My line 1 (modified)" > readme.txt
git add readme.txt
git commit -m "feature a version 2"
# merge feature a into debian
git checkout debian
git merge feature_a -m "merge feature a"
# modify feature b, make it conflict with feature a