Breaking down a massive OEM commits
git reset HEAD^ drivers/gpu
This resets the HEAD and only grabs the directories I specify
git commit --amend
This obviously amends the original commit
git add --all
This adds the directories I specified above
git commit -a -m "Import OEM gpu driver changes"
This obviously adds the commit message
And finally this is the weird part
git rebase -i HEAD2
After that last command is executed it will display a commit window.
This rebases and displays the last 2 commits in the repo. The original Xiaomi commit is on top and my commit is underneath. Xiaomi commit being the 2nd and mine being the first. So I need to move that Xiaomi commit to be the latest commit in git history.. Ctrl+k to cut the Xiaomi commit, and Ctrl+u to paste it under my commit. Boom, history is re-written and my commit is now older in history so I can proceed to do the same thing over and over again to the rest of the
directories in this massive commit.
Then you get sexy commit history like this and makes things easier to find when you hit conflicts or build errors after >merging your kernel with kernel-msm or caf or upstream.