"Vegard Nossum" <vegard.nossum@xxxxxxxxx> writes: > So in this specific case, I want to check out v2.6.25 of linux-2.6.git > and re-apply all the changes that were made to the file > net/mac80211/rc80211_pid_algo.c between v2.6.25 and v2.6.26-rc4. > > In order to determine which commits I need, I used the following command: > > $ git log --follow v2.6.25..v2.6.26-rc4 net/mac80211/rc80211_pid_algo.c The commits given by that will contain ones that are based on the file from a version way older than v2.6.25, which were merged to the history after v2.6.25. $ git log -m --pretty=oneline --abbrev-commit v2.6.25..v2.6.26-rc4 -- \ net/mac80211/rc80211_pid_algo.c 2c8dccc... mac80211: rename files d0709a6... mac80211: RCU-ify STA info structure access 902acc7... mac80211: clean up mesh code ee38585... mac80211: mesh data structures and first mesh changes 6f48422... mac80211: remove STA infos last_ack stuff b7c50de... rc80211-pid: fix rate adjustment 8318d78... cfg80211 API for channels/bitrates, mac80211 and driver conversion 8318d78 has diverged from the mainline way before v2.6.25, and there even is another patch before v2.6.25 that was applied to the mainline: $ git log --pretty=oneline --abbrev-commit --left-right \ 8318d78...v2.6.25 -- net/mac80211/rc80211_pid_algo.c >1d60ab0... rc80211-pid: fix rate adjustment <8318d78... cfg80211 API for channels/bitrates, mac80211 and driver conversion So it is _very_ natural that application of 8318d78 to v2.6.25 _will_ have conflicts that you would need to resolve. All of the above was first merged into the mainline with 334d0945, which is a merge of d1643d2 into d1a4be6. An interesting experiment is to start from 334d0945 and revert the above commits (only for the path you are interested in) in the reverse order: $ git checkout 334d0945 $ for c in 2c8dccc d0709a6 902acc7 ee38585 6f48422 b7c50de 8318d78 do git show --pretty=email -R $c -- net/mac80211/rc80211_pid_algo.c done | git am Then, the difference between the result and v2.6.25 would show the fixup you would need to squash into when you apply 8318d78, _if_ you trust what Linus did when 334d0945 was made: $ git diff v2.6.25 -- net/mac80211/rc80211_pid_algo.c >P.diff This looks as if 1d60ab0 is being reverted. But the moral equivalent of that patch is included as b7c50de in the history post v2.6.25, and that is why the result is Ok. If you apply P.diff on top of v2.6.25, then apply 8318d78 (only for the path), and b7c50de (because it is redoing what you are reverting with P.diff), that would be the forwarded-ported 8318d78 for v2.6.25. $ git checkout v2.6.25 $ git show --pretty=email 8318d78 -- net/mac80211/rc80211_pid_algo.c | git am $ git reset --hard $ git apply --index P.diff $ git apply --index .dotest/patch $ git show b7c50de -- net/mac80211/rc80211_pid_algo.c | git apply --index $ git am --resolved After that, remainder can be picked as before, but in the forward order: $ for c in 6f48422 ee38585 902acc7 d0709a6 2c8dccc do git show --pretty=email $c -- net/mac80211/rc80211_pid_algo.c done | git am and the resulting net/mac80211/rc80211_pid_algo.c will match the one from v2.6.26-rc4 exactly. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html