Applying A Diff?

I have finally got Blender to compile and launch under OSX using xCode! I followed the steps on the Blender site.

So now I want to go one step further and apply a working DIFF to see if I can truly have my own modified version of Blender. The diff I want to try out is here. https://developer.blender.org/T22084

So what are the next steps?
How do I apply a DIFF to my local source code?
By manually inspecting the DIFF file I can see that parts of the code belong in one file and parts in another.
Is this a manual chore at this point?
Or is there some automated system that will read in the code and apply it to the correct files?

Thanks, still a newbie at compiling Blender.

If you are using git

make a new branch
then apply the diff


git checkout -b atoms_test_build
git apply filename.diff

Return to master with


git checkout master

So do I have to do that for every file? There are 12 in this case.

I don’t understand GIT fully. What does return to master mean? I don’t want to post anything back or break other peoples code.

I already have done a check out and have that build working. I want to apply to my local working Blender code.

How does git know where the DIFF is?


git apply filename.diff

Do I download the DIFF files locally and use a local path for the apply?

No the 12 files are a historical list from the OP onwards, go for the latest one. https://developer.blender.org/file/data/qjtthjzkts3cv4dwvwgm/PHID-FILE-ojo7itwfb3gnnk5vdwii/ease_28564e158389eb3c6a1dc7d0f2f6fd5271d3fe1f.diff

The hash is the key, like the old SVN revision number. Look up the docs there is a -check or similar to test whether a diff is OK, or you may have some GIT gui on the mac.

You can put a fully qualified path into the apply diff command.

http://git-scm.com/docs/git-apply

useful link http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/

Using a branch lets you make changes that are saved to the branch that don’t effect the master code. Once again look up this in the GIT docs, there are plenty of good examples on stackexchange and other sites on using branches.

http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

Thanks for the links I guess I have to figure out Git.:o

You can use patch too, never used the built in git apply thing myself:


patch -p1 --dry-run < ../path/to/patch.diff

If that works then remove the --dry-run part and it’ll apply the changes. Sometime you have to change the -p level depending on where the diff came from, svn uses -p0, git -p1 – you can usually tell by patch asking which file you want to apply the changes to.

@Uncle Entity: Thanks for the dry run command line.
But I am having problems getting this to work.

I have downloaded and renamed the DIFF file from the batFinger link above. I have placed it on my desktop and named it ease.diff.

I open terminal and change to the blender-build directory.

I issue your command with my path to the DIFF but the terminal reports that something is missing.

patch -p1 --dry-run <  "/Users/Developer/Desktop/ease.diff"


When I get stats or apply a check the system tells me I am missing files so do I need to download all those other 12 files? Or can I simply point git at the URL of the file and not bother with downloading?


It looks like you have the wrong directory, you want to be at the root directory of your repository, in my case that’s

F:/BlenderGIT/blender

It appears you are in your build folder, hence the lack of source.

Below is the output from git bash on my system. I’ve created a new branch named easing, and checked the patch. All looks well so I can now apply the patch and build blender. If I want to go back to “el stocko standardo” blender I simply checkout back to master.


Welcome to Git (version 1.8.4-preview20130916)




Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.


Administrator@GRUNTBOX /F/BlenderGIT/blender (master)
$ git checkout -b easing
Switched to a new branch 'easing'




Administrator@GRUNTBOX /F/BlenderGIT/blender (easing)
$ git apply --check --verbose F:/blender/Patches/ease.diff
Checking patch release/scripts/startup/bl_ui/space_graph.py...
Hunk #1 succeeded at 189 (offset 11 lines).
Checking patch source/blender/blenkernel/CMakeLists.txt...
Checking patch source/blender/blenkernel/intern/fcurve.c...
Checking patch source/blender/blenkernel/intern/fcurve_easing.c...
Checking patch source/blender/blenkernel/intern/fcurve_easing.h...
Checking patch source/blender/editors/animation/keyframes_edit.c...
Hunk #1 succeeded at 922 (offset 42 lines).
Hunk #2 succeeded at 1001 (offset 42 lines).
Hunk #3 succeeded at 1075 (offset 42 lines).
Checking patch source/blender/editors/include/ED_keyframes_edit.h...
Hunk #1 succeeded at 217 (offset 10 lines).
Checking patch source/blender/editors/space_graph/graph_buttons.c...
Checking patch source/blender/editors/space_graph/graph_draw.c...
Checking patch source/blender/editors/space_graph/graph_edit.c...
Checking patch source/blender/editors/space_graph/graph_intern.h...
Hunk #1 succeeded at 112 (offset 1 line).
Checking patch source/blender/editors/space_graph/graph_ops.c...
Hunk #1 succeeded at 227 (offset 1 line).
Checking patch source/blender/makesdna/DNA_curve_types.h...
Hunk #2 succeeded at 348 (offset 3 lines).
Checking patch source/blender/makesrna/RNA_enum_types.h...
Checking patch source/blender/makesrna/intern/rna_curve.c...
Checking patch source/blender/makesrna/intern/rna_fcurve.c...
Hunk #2 succeeded at 77 (offset 7 lines).
Hunk #3 succeeded at 1660 (offset 29 lines).


Administrator@GRUNTBOX /F/BlenderGIT/blender (easing)