backporting f2fs linux driver using git format-patch or bundle

320 views Asked by At

I try to backport the f2fs filesystem driver from linux-3.13-rc4 to my workstation running 3.7.10-1, where f2fs does not exist yet. I have first tried to simply copy the fs/f2fs directory to my workstation, but that does not compile because some internal vfs helpers have changed between 3.7 and 3.13. So I tried to take the full git history of fs/f2fs using

git format-patch 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5^ fs/f2fs/

where the mentioned commit ("f2fs: add superblock and major in-memory structure") is the commit creating the fs/f2fs/ directory, and then

git am *.patch

Here, git am does not succeed: some commit do not apply, either because they are already applied (there are two copies of the same patch in the patches produced by git format-patch) or because the patch is missing (result of a merge). I would like to get the history in my copy to be able to bissect, and then remove the vfs_helper-induced changes, while keeping the later bug-fixing.

Any hint ?

1

There are 1 answers

0
Philippe De Muyter On

Expanding sun's answer to a related question Git: How to create patches for a merge?, I finally found a solution :

   git log -p --pretty=email --stat -m --first-parent --reverse \
   39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5^..master fs/f2fs/ | \
   csplit -b %04d.patch - '/^From .*$/' '{*}'
   rm xx0000.patch

This creates patches called xx0001.patch to xxnnnn.patch, that one can apply with

   git am *.patch