yashsingh1/xdaforums huggingface dataset:
[Android] Walterwhite007:
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
[Android] jabza:
Cherry-picking multiple commits is pretty straightforward. Once you've resolved any conflicts for one commit, you have to finish by using the command

git commit

if you want to add another cherry-pick in the same location.

Once you've committed that, you should be able to start the cherry-picking process over again exactly the same. If you have an issue, can you tell me what your terminal says, or post a screenshot?

To build ParanoidAndroid, you first have to download the source to your computer. So you'd have to make a directory and use "repo init -u http://github.com/AOSPA/manifest.git -b kitkat && repo sync" to start the download. It's a big download, so be ready to wait a couple hours. There's a good guide for building ParanoidAndroid 4+ here

However, as far as forking a repository, you only need to fork the repositories that you want to make your own changes to and keep track of. Really, you don't have to fork anything.
[Android] timpohladthomas:
Nicely written.
[Android] Aceofzeroz:
+100

Took the workds right outta my mouth!!:laugh::highfive::cool:
[Android] Walterwhite007:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
[Android] jabza:
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
[Android] Walterwhite007:
Thanks bro. I tried many times cherry picking halo but that always messed up. Now after following this great guide I'll give it another try !!

Say my name
[Android] roshan2989:
Thank you so much for the awesome thread..:good:
[Android] xxLeoxx93:
Very good tutorial :good:

But I've two question:

- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?

- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
[Android] jim_moriarity:
I was hoping that someone could help me here so the problem is that I am trying to build OMNI ROM for mako but even after following the guide I dont't see any zip out/target/product/mako. I followed this guide http://docs.omnirom.org/Build_for_mako
[Android] jabza:
- "git commit" tells your computer it's done with editing and finishes the cherry-pick process. That is when git saves your resolution, so that if you go back and cherry-pick that commit again it can automatically apply your resolution to the problem. The ROM will compile without this command, but you won't be able to use "repo sync" to update that project or add any other cherry-picks to that location until you run "git commit" or "git cherry-pick --abort", which removes the cherry-pick altogether.

- When you rebuild the ROM, as long as you don't use "make clean" or "make clobber", it will only recompile the parts that have changed. The next build will go much faster. If you want the builds to go even faster, you should use ccache.
[Android] jabza:
This is probably a better question for somewhere else, but I can try to help you anyways. Can you tell me what the output of "ls out/target/product/mako" is?
[Android] G1ngerN1nja:
How did you find the commits on Gerrit? Tried searching HALO but nothing comes up
[Android] jim_moriarity:
There are two folders obj and system and two makefiles clean_steps.mk and previous_build_config.mk
[Android] p4rot:
As stated here:

Once you do “git status” and all the files turn up green, you have finished resolving the conflicts. Now is the best time to compile your ROM and see if your changes worked. If you're in a rush (or lazy or don't feel like waiting for a ROM to compile or you've already tested it), you can now commit your changes.

Does that mean i can git commit after i built the rom?

And if i can do so,, do i have to git commit in the same location that i cherry picked ?

I guess so but im not sure.

Also thanks for the guide, like other said that was totally what i was looking for , i was familliar with the process of building from source but cherry picking no.
[Android] jabza:
Halo is under the "abandoned" section of gerrit, since PA decided to drop Halo. So in the top left, press "abandoned" and go back a few pages.

Try doing these commands in order:

. build/envsetup.sh
lunch
make -j16

And when you run the lunch command, choose mako from the list.

You can use "git commit" after you've built the ROM. You have to do "git commit" in the location that you started the cherry-pick, since each folder is its own git repository. Best practice is to resolve the conflicts, build the ROM and make sure it all works appropriately, and then run "git commit". Sometimes you want to move on to cherry-picking other things in that location or have other reasons not to do it that way, but regardless of when you do it, you have to run "git commit" eventually before you can add another commit or do a repo sync of that project.
[Android] jim_moriarity:
Even after following your instructions I don't get any result.
[Android] xxLeoxx93:
So, if I use first "brunch", then cherrypick and than use "brunch" again, it creats me a zip-file with only the cherrypick in it?
[Android] jabza:
Does your terminal say that there were any errors? You won't get a zip if something stopped it from building.

It'll be a full ROM zip. Your computer will re-use what it compiled last time and only recompile the parts that were changed since then.
[Android] katinatez:
Thank you so much for tutorial just learned how to compile from source but having difficulty with cherry picking. I have been compiling OmniRom for I9300 and am trying to cherry pick Lockscreen notification from Omni Gerrit. And here are the links

https://gerrit.omnirom.org/#/c/5734/

https://gerrit.omnirom.org/#/c/6062/

I have done this a couple times and now its throwing up a message I have not seen before and here is the message from terminal.

john@X58:~$ cd ~/android/omni

john@X58:~/android/omni$ cd frameworks/base

john@X58:~/android/omni/frameworks/base$ git fetch https://gerrit.omnirom.org/android_frameworks_base refs/changes/34/5734/21 && git cherry-pick FETCH_HEAD

From https://gerrit.omnirom.org/android_frameworks_base

* branch refs/changes/34/5734/21 -> FETCH_HEAD

HEAD detached from 0f7dace

You are currently cherry-picking commit 931f929.

nothing to commit, working directory clean

The previous cherry-pick is now empty, possibly due to conflict resolution.

If you wish to commit it anyway, use:

git commit --allow-empty

Otherwise, please use 'git reset'

john@X58:~/android/omni/frameworks/base$

The steps I did was to follow your directions about the gerrit but after I cherry pick I then started

. build/envsetup.sh

brunch i9300

Question am I missing a terminal command to apply the commit? And what is the command?

Next question is I set ~/android/omni/prebuilts/misc/linux-x86/ccache/ccache -M 25G but if I view my disk space it show 50GB, I think I ran this command twice and how do I check that? And how do I remove 25GB cache?

Thank you any help would be appreciated.
[Android] jabza:
That means that your repository already has that commit. It looks like you've already started that cherry-pick or it's already been committed. You can do "git status" to see if there are any files that need to be resolved, and you can do "git log" to see if you've already committed that cherry-pick (press "q" to leave the log). If you have already done the command to grab the cherry-pick and resolved the errors, you can do "git commit" to finalize the commit.

If you do ~/android/omni/prebuilts/misc/linux-x86/ccache/ccache -M 25G, it just sets your ccache to 25G. Even doing it twice will just tell your computer "set the ccache size to 25 GB". You might be looking at the entire build directory, though. The cache is stored in ~/.ccache (with the period). It should stay at the size you set it. Google recommends 100GB for your cache, but admits that 50 will do.

If you want to remove the cache (it will need to be rebuilt during your next build), you can run this command:

sudo rm -r ~/.ccache
[Android] jjardinero.01:
Awesome guide. Thanks!

BTW, Its my first time compiling cyanogenmod from source. For now its just a stock CM11. Im planning on adding Paranoid Android features to my CM build but my problem is I dont know what to cherry pick. Can someone pls help me provide links to these features: Quick Settings tiles and Lock Screen. Thanks! Any help would be much appreciate.
[Android] p4rot:
Lets say i make a mistake,,like i just did btw, and cherrypicked in the wrong directory, what should i do to remove it without affecting anything else ?

Because at the moment when i make a mistake and dont want to get error in builds later i remove the whole folder containing the aosp source and its very time consumming to wait to redownload the whole aosp source.
[Android] azoller1:
dont delete the whole folder just the file/folder you cherrypicked in, like say i cherry picked a wrong thing into the settings apps, i would go to packages/apps/settings and remove just that folder, then resyncing shouldnt take that long
[Android] jabza:
Chances are, if you cherry-pick something in the wrong folder, it just won't apply. If you notice it before you've committed it (with the command "git commit"), you can just use the command "git cherry-pick --abort". It'll quit the cherry-picking process.

However, if you've really messed up a certain directory and don't know how to get back to a workable state, you can just delete the directory you cherry-picked in and do "repo sync" from the base of your AOSP source. It'll just redownload that folder.
[Android] sirovai:
Can you make a guide also for forking project and save our work on github?

Thank you!
[Android] jabza:
Sure thing, I'll write something up tonight.
[Android] Rycon33:
Guys, I've been searching around but no luck atm, can anybody point where are the commits feom Mahdi rom for "Navigation Bar height adjustment"?

Edit: nvm, found it.

Tapatalked from my Xperia
[Android] opticore:
Great guide which covers everything you need to successfully cherry-pick. Thanks so much for posting this! Although I do have a question about moving in entire folders from Cyanogemon to my Vanilla AOSP, for example I want to use frameworks_av and frameworks_base to start but when I use those folders and files to build I always get a ton of errors. Is there something i'm missing? Do I need to merge? Any help is greatly appreciated.
[Android] AnthonyyBayn:
**Warning! Noob Alert!**

So does cherry-picking download the source code and apply it to the source so that when you compile, you have that feature? If so that seems like an incredibly simplistic and easy way to get features from other ROMs, I would've expected it to be more complicated than that.
[Android] JJsevol:
Yes it does. Once you download and apply to wherever it belongs and compile you'll have that feature.
[Android] Rycon33:
^^^ I can tell you, it is not as simple as that. Most are tricky to be implemented in the ROM properly. Some depends on an already existing previous codes that is not readily shown in the cherry pick diff. Maybe easy for those already experienced ROM maker.
[Android] AnthonyyBayn:
Ok thanks. So I don't have to edit any code apart from to fix any conflict errors?
[Android] Rycon33:
^^ Compile and try. That's the best way to check if the cherry pick works properly. From my experience(still as a newbie though), I can do those simple tweaks and mods but most of the time I failed on most cherry picks I tried, even the compilation went good.
[Android] AnthonyyBayn:
Also I've seen "git pull" being thrown around alot. I heard it automatically merges? Does it do a similar thing to cherry-picking or is it for an entirely different purpose?
[Android] JJsevol:
I wasn't sure about this because I've only been doing cherry picking, but I found this explanation:

https://news.ycombinator.com/item?id=612132
[Android] AnthonyyBayn:
Thank you very much :)

I think I'll stick with cherry-picking then
[Android] AnthonyyBayn:
I can't appear to find any of the base features from, for example, SlimKat's Github or Gerrit. I just find a load of fixes and addons for features that are already in SlimKat ROMs.

Where do I find the base features that I can actually implement into my CM source?
[Android] spida_singh:
Appreciate the guide, having some issues with a commit i cherry picked from github. It went in all OK, and i sorted out all the conflicts, but when i got to lunch the build (Vanir for the Z2) the commit is ignored

[xxsskxx@BBQLinux sony]$ ((detached from b314f90))

$ git status

HEAD detached at b314f90

Ive been lookign through stack overflow as well, trying to gete this right, and the branch and head in correctly, just need to know the 'right' way.

Any idea?
[Android] ezio84:
After you solve conflicts, commit them:

git add .

git commit -a

(there are a space and a dot after "add").

So the new cherry-picked code will be recorded. Then you can build.
[Android] spida_singh:
I did that, and it committed fine, saw the nano message etc, its during the build part, i saw the not part of a branch message, so when i lunch the , it states the commit is ignored.
[Android] ezio84:
Git checkout on a branch before cherry picking and committing:

git checkout kk4.4

git cherry-pick

(If there are conflicts solve them, then:

git add .

git commit -a)

If the local branch kk4.4 doesn't exist, git will create it.
[Android] spida_singh:
Thanks, just as a quick reference for myself, would this be the correct order / process

Source Sync

mkdir ~/vanir

cd ~/vanir

repo init -u git://github.com/VanirAOSP/platform_manifest.git -b kk44

repo sync j8

Checkout

git checkout kk44

Cherry pick, solve conflicts then

git cherry-pick --strategy=recursive -X theirs e1572513f08b1bb4c427ef426d52a994a00af10

git add . (assuming this is for the files / conflicts i want to keep)

git commit -a

Build

. build/envsetup.sh

lunch vanir_sirius-userdebug

mka bacon -j4

Wait for zip and flash and keep fingers crossed :)

For reference, my head data using git reflog

b314f90 HEAD@{3}: checkout: moving from 17bbc4a3b88dc3d6e9d49a86a13370dea46fbb20 to b314f903325c1fdf

17bbc4a HEAD@{4}: commit (cherry-pick): sirius: use honami camera blob

Appreciate the help guys.
[Android] ezio84:
I don't use/know this:

git cherry-pick --strategy=recursive -X theirs e1572513f08b1bb4c427ef426d52a994a00af10

Here are my steps:

repo init -u ... -b ...
repo sync

Then the cherrypicking from github:

git remote add NameYouWant https://github.com/xxx/project_you_cherrypick_from
git fetch NameYouChoseInThePreviousStep
git checkout kk4.4 (or a new local branch if you want)
git cherry-pick e1572513f08b1bb4c427ef426d52a994a00af10

or cherrypicking from gerrit: just use the cherrypick link provided in the commit page, skipping git remote add and git fetch.

If there are no conflicts, i go to the build process:

. build/envsetup.sh && lunch
make bacon -j# (or mka bacon instead of make bacon -j# to use all cpu resources)

If there are conflicts, i edit files to solve them, then:

git add .
git commit -a

then to the build process.
[Android] spida_singh:
Just a quick question, I receive the following during the commit and my git status (this is just a sample, there are more like this):

both modified: shinano-common/proprietary/lib/libcald_client.so
both modified: shinano-common/proprietary/lib/libcald_pal.so
both modified: shinano-common/proprietary/lib/libcald_server.so
both modified: shinano-common/proprietary/lib/libexcal_system.so
both modified: shinano-common/proprietary/lib/libmmcamera_interface.so
both modified: shinano-common/proprietary/lib/libmmjpeg_interface.so

When i choose to 'add' the files, are these adding the ones taken / fetched from the commit, or keeping the ones already in the local folder (in essence these WONT be getting overwritten)

I actually need to have my local .so files overwritten by the ones being fetched form the commit, so just trying to understanding what 'add' is actually doing.

As described above, am i best using

"git add . " as it applies new and modified files, without performing deletions, so this 'takes the commits files and creates them and modifies / overwrites existing ones as required, without performing any required deletions?

Thanks again.
[Android] MiyagiSan:
Hi. Thanks for the guide.

Say I am trying to build an unofficial CM11 release with bits cherry-picked potentially from anywhere. I would still like to maintain a build manifest that makes it easy for anyone else to replicate my build using the manifest file (as long as they have read access to the same set of repos obviously). How do I do that?

Incidentally, does the build manifest file exist for all AOSP projects? Or is it just a Cyanogenmod thing?
[Android] StrangerWeather:
Quick question: What if there is nothing between <<<<<<< HEAD and =======? How is this resolved?

<<<<<<< HEAD
=======
[Android] bsmitty83:
That means there is nothing to delete . usually it happens when you cherry-pick a commit and its trying to delete code that isn't there
[Android] AnimusVoxx:
How do you determine how many "jobs" or "threads" your cpu can handle when building or syncing code?
[Android] bsmitty83:
General rule of thumb is number of cores you have on your system is the number of jobs you can run . double it if you have an Intel chip due to hyperthreading . amd you can get away with number of cores +1 , but thats pushing it .

For example , I have a dual core amd laptop I build kernels on , I can run make -j3 and it taxes my system hard .
[Android] AnimusVoxx:
My macbook has a core i7 so your saying I can get away with 7 or even 14?
[Android] bsmitty83:
Should be OK , technically I believe its only a dual core chip , but i7 is a powerhouse . you can try any number , worst that will happen is it'll slow your machine down to a crawl or lock it . nothing a reboot won't fix
[Android] AnimusVoxx:
Anyone know how to add your own boot animation successfully with no errors and also how to add your rom name into your repo so that when you build and flash the rom when you go into the about phone menu it says aosp version or aokp rom version "NAME OF MY ROM" I can't figure it out
[Android] AnimusVoxx:
hey guys i know this is a bit off topic but can anyone help me with this error im getting, cant find any answers on the web but figured u guys would know whats up, any answers are appreciated, thanks.

Symlink: /Volumes/aokp/out/target/product/m8/system/bin/su -> /system/xbin/su

make: *** No rule to make target `/Volumes/aokp/out/target/product/m8/obj/SHARED_LIBRARIES/libqdutils_intermediates/export_includes', needed by `/Volumes/aokp/out/target/product/m8/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/import_includes'. Stop.

make: *** Waiting for unfinished jobs....

Export includes file: frameworks/native/services/surfaceflinger/Android.mk -- /Volumes/aokp/out/target/product/m8/obj/SHARED_LIBRARIES/libsurfaceflinger_intermediates/export_includes
[Android] MiyagiSan:
LMGTFY ----> found this
[Android] AnimusVoxx:
Yup I saw this but it didn't help my issue.
[Android] reS28raM:
Take a look here:

https://github.com/ezio84/vendor_slim/commit/7fee72dddb90f34efa850a16c86132bccd46b133

And here:

https://github.com/ezio84/vendor_slim/commit/f3b33595814abacaec65ea9a93e1c63309881873

Sent from my Nexus 5
[Android] MiyagiSan:
A few more you may have seen too...

Getting strange error plus suggested fix

Build fails for Android JB422_100

Android building no rule to make lib
[Android] MiyagiSan:
Anyone able to help here?

Anyway, after a bit more reading and thinking, at the moment, it seems that the simplest way to handle unofficial CM11 builds using cherry-picking whilst maintaining a build manifest is to:

a) fork the specific CM11 git repos one will be adding cherry-picked commits to

b) cherry-pick one's commits into these forks of the CM11 repos

c) use a local manifest xml file in .repo/local_manifests to replace the original CM11 repos with one's forks of the repos

d) right after the build, run the command: repo manifest -o my-build-manifest.xml -r

Now, anyone with a copy of the my-build-manifest.xml file can replicate the build if they have access to the forked repos.

Does this seem right? Messed up?
[Android] AnimusVoxx:
hey guys im building aokp for my htc one m8 and im trying to add two cherry picks from paranoid android, well i guess technically three but here they are

Change I3bc7102b: https://gerrit.paranoidandroid.co/4787

Change Id2b105df: https://gerrit.paranoidandroid.co/4788

Change I47a021df:https://gerrit.paranoidandroid.co/4790/

but whenever i do i can succesfuly add them, i can remove the errors from the files and then git add but whenever i do something pops up that says "untracked files" and list the files i just altered in red, i try to git add those files again but nothing happens, then when i try and build i get errors, can anyone shed some light on this "untracked files" thing and how to possibly fix it?
[Android] GSUS969:
When trying to clean edits via "gedit /filepath.xml"

I receive "-bash: gedit: command not found"

Any thoughts? I'm on Mac OSX 10.10 Yosemite if that matters.
[Android] katinatez:
After git add files, type git status it will show you the untracked files in red if everything comes up green it's ready to be pushed to remote, you probably missed one file. If your getting errors building, check to see if you have conflicts in files.

---------- Post added at 01:24 PM ---------- Previous post was at 01:09 PM ----------

I can help you, if you want your name on flashable zip file like this " cm-11-20141007-UNOFFICIAL-temasek-bacon-V146.zip" look at line 34 & 35 here https://github.com/katinatez/android_device_oneplus_bacon/blob/cm-11.0/cm.mk

If you want name and version of build look at line 5-8 here https://github.com/temasek/android_packages_apps_Settings/blob/cm-11.0/res/values/cr_strings.xml

I dont know about bootanimation, maybe someone smarter can tell us.
[Android] p4rot:
Im trying to cherry pick something from github but thats what i get :

HEAD detached from c482a9d

Changes not staged for commit:

(use "git add/rm <file>..." to update what will be committed)

(use "git checkout -- <file>..." to discard changes in working directory)

deleted: core/res/res/values/config.xml~