Generate patches for all commits

This one is about creating a bunch of patches for each commit.

First list all commits by commit hash

git log --pretty=oneline

which produces this:

[email protected]:~/Note2Core-GT-N710x_Kernel$ git log --pretty=oneline
db31b055b9096f8350144438901af6925b4629e3 sched: don't call task_group() many times in set_task_rq()
ce6efedc9eae826d328f96dfc664e609225cffe9 CPU unaligned access path
1ca9237911877f76cd60c950b8c1826b5ad4b2c4 Added -pipe to primary makefile
29369e159661e51c5192df960fd78c5d7eeb289d sensors: update device sensors
a40c7009bde4d620fe561ca087726be4eaa7de9c add Triangle Away (chainfire) support
96104e2a18a619521d0c204a53640334e7d46665 small cleanup to makefile
37a5d18b8d3a29b8671476cc3b090cad3212a556 sound-soc: Sound platform and WM1811 changes
5e84a63dbbf3255b26e43446e29862972bf5670e note2core defconfigs update 1.05
e94bee447115f56a6a0e2b701ba6f4dd71bc9e69 fix config selection of 1.8ghz and FSync
a889fed4ccf8105822874bf82e05c819d2f119d9 mach-exynos: cpuidle-exynos4: set logging default to disabled
3c4092a30eb23e5c817a694e246923b41e39f6d6 another fix to cpu frequency tables
2b0b02a53fa915da06c1519a5c1559c31cc126a1 fix to cpu frequency tables
2c305d77b1ebd8a45242312ae693764de11630a9 Corrected makefile
6b816ffb7b9b3d48554424c668aa24153c1518ca note2core defconfigs v1.04 for non LTE and LTE
25593b3670db08687f1dfe7bba7acc81d6658c9b fix a build error if debugfs disabled
2463f4382e8539001b2368a0fa91e914955e6336 some minor crypto changes
ecbd8f920d4b05102b5bdf8661350424e9af9f25 CRC32 slicing-by-8 algorithm
5c43b013b61a074e8c0a40ae233033926fde1e63 Add optimized ARM RWSEM algorithm, and enable in config  Credit:Ezekeel
ea9f634c636947b9824207cf981c3fd7f6c25972 lib/sha1: use the GIT implementation of SHA-1
cf57b5fbe2460be6b589ee6e53d258237d3b8f4f arm: remove 'optimized' SHA1 routines
84dddf910dcfb8d53a5efb3d7e2f408c8438651b kernel: make an exception in module loading to load proprietary modules Credit:gokhanmoral
5cfc710720e602b41548f152d4accebd894295af arm:remove stale export of 'sha_transform'
b7765c83b1608e6c956ecf2bd68b38ab2ca59693 lib/memcopy: use glibc version Credit:faux123
4d659526b2cd2ac4ea8f2fe6d102b24cf7f5773e lib/string: use glibc version Credit:faux123
413abc3ec2e4ce9046d4745c84ec4fdd85d2fd7b Sensorhub - fix firmware mislabelling and version check - Credit:Andreilux
ce730621b834433db9f91f50f59606e093840ccd Add 1.6/1.8ghz optional cpu frequency table (1.8ghz frequency table credit to Andreilux) and voltage control interface
84c03d4fac7145a06199cfbe306ddbef66b70394 reduce busfrequency increase threshold
0b8e0522b367758607c25f9e55d7e283d0c3fb0f Fix build error if debugfs disabled
a3b3d407e7031e846c222662211c102e8672f170 Always mount all partitions with noatime
a639d7355d6a89d8dcf67d8e7b54d02b4ade5aed Add optional FSync() disable
e74fced9a02942fd34813b3366635cd9cabc2aa0 disable some multicasting during sleep Credit:Andreilux
d19729546a80f1eba64c7885658cffe44feb2b72 fix usb gadget build error if debugfs disabled
24c407a2d5d6ee88ee3b879ad730ea0a24211e10 remove mali state tracking, adjust mali dvfs utilisation steps
d7130a2f16e908f329f63ad2f260d3f5df9888b1 remove double MALI kconfig entry
2c8cfb8f62937a6a5aeb699a4ff5ceb6bc929303 remove debugging from MMC
5e61f07bdadedf5580443074503e5284c6c3daba disable GENTLE FAIR SLEEPERS, enable HRTICK
30fb717fa19b6a913366bdfd929874ab60c0208d add support for customised VM memory settings and readahead
e594a15d06d12c1b64b5a045518ad9b0fc32dca3 little name tweak to kernel version
e3e97b139aedc7c5a021ee805e353224b557b565 add VFP neon optimisation
03130ec51fbdc4c444cfcb9c70f4469f9f467387 Add customised makefile
a7bc9b38a6cd76703ead47b8c2a1aaf79568641e Change some debug options, add optimization options
ce49a86a24e64a7f8083e7cef85db420bbcb1004 Initial source dump from Samsung GT-N7100_HK_Opensource

Now we need to provide the range of commits over which we want patches to be generated, also specify the output directory

git format-patch -M -C --output-directory /tmp/patches db31b055b9096f8350144438901af6925b4629e3...ce49a86a24e64a7f8083e7cef85db420bbcb1004

I’ve provided the first and last commit as options.

This produces the bunch of commits:

git format-patch -M -C --output-directory /tmp/patches db31b055b9096f8350144438901af6925b4629e3...ce49a86a24e64a7f8083e7cef85db420bbcb1004
/tmp/patches/0001-Change-some-debug-options-add-optimization-options.patch
/tmp/patches/0002-Add-customised-makefile.patch
/tmp/patches/0003-add-VFP-neon-optimisation.patch
/tmp/patches/0004-little-name-tweak-to-kernel-version.patch
/tmp/patches/0005-add-support-for-customised-VM-memory-settings-and-re.patch
/tmp/patches/0006-disable-GENTLE-FAIR-SLEEPERS-enable-HRTICK.patch
/tmp/patches/0007-remove-debugging-from-MMC.patch
/tmp/patches/0008-remove-double-MALI-kconfig-entry.patch
/tmp/patches/0009-remove-mali-state-tracking-adjust-mali-dvfs-utilisat.patch
/tmp/patches/0010-fix-usb-gadget-build-error-if-debugfs-disabled.patch
/tmp/patches/0011-disable-some-multicasting-during-sleep-Credit-Andrei.patch
/tmp/patches/0012-Add-optional-FSync-disable.patch
/tmp/patches/0013-Always-mount-all-partitions-with-noatime.patch
/tmp/patches/0014-Fix-build-error-if-debugfs-disabled.patch
/tmp/patches/0015-reduce-busfrequency-increase-threshold.patch
/tmp/patches/0016-Add-1.6-1.8ghz-optional-cpu-frequency-table-1.8ghz-f.patch
/tmp/patches/0017-Sensorhub-fix-firmware-mislabelling-and-version-chec.patch
/tmp/patches/0018-lib-string-use-glibc-version-Credit-faux123.patch
/tmp/patches/0019-lib-memcopy-use-glibc-version-Credit-faux123.patch
/tmp/patches/0020-arm-remove-stale-export-of-sha_transform.patch
/tmp/patches/0021-kernel-make-an-exception-in-module-loading-to-load-p.patch
/tmp/patches/0022-arm-remove-optimized-SHA1-routines.patch
/tmp/patches/0023-lib-sha1-use-the-GIT-implementation-of-SHA-1.patch
/tmp/patches/0024-Add-optimized-ARM-RWSEM-algorithm-and-enable-in-conf.patch
/tmp/patches/0025-CRC32-slicing-by-8-algorithm.patch
/tmp/patches/0026-some-minor-crypto-changes.patch
/tmp/patches/0027-fix-a-build-error-if-debugfs-disabled.patch
/tmp/patches/0028-note2core-defconfigs-v1.04-for-non-LTE-and-LTE.patch
/tmp/patches/0029-Corrected-makefile.patch
/tmp/patches/0030-fix-to-cpu-frequency-tables.patch
/tmp/patches/0031-another-fix-to-cpu-frequency-tables.patch
/tmp/patches/0032-mach-exynos-cpuidle-exynos4-set-logging-default-to-d.patch
/tmp/patches/0033-fix-config-selection-of-1.8ghz-and-FSync.patch
/tmp/patches/0034-note2core-defconfigs-update-1.05.patch
/tmp/patches/0035-sound-soc-Sound-platform-and-WM1811-changes.patch
/tmp/patches/0036-small-cleanup-to-makefile.patch
/tmp/patches/0037-add-Triangle-Away-chainfire-support.patch
/tmp/patches/0038-sensors-update-device-sensors.patch
/tmp/patches/0039-Added-pipe-to-primary-makefile.patch
/tmp/patches/0040-CPU-unaligned-access-path.patch
/tmp/patches/0041-sched-don-t-call-task_group-many-times-in-set_task_r.patch

I did this because I found that I had weird errors while compiling the kernel for Note2, and other devs did not. Obviously I wanted to find out at what point they fixed the issue. So I what I wanted was to essentially walk over each commit and try to compile a kernel at each time

I then got the specific patch from Github. Just look at a commit, get it with suffix .patch

cat the patch see the diff level

patch -Rp1<patchfile.patch