Error formatting macro: pagetree: java.lang.NullPointerException

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A stale patch means one that used to apply cleanly to the latest Clojure master version, but due to commits made since the patch was created, it no longer does.  In particular, the output of this command:

Code Block
languagenone
%$ git am --keep-cr -s --ignore-whitespace < patch_file

...

To apply such a patch, the 'patch' program by Larry Wall is extremely useful.  It comes preinstalled with Mac OS X and most Linux distributions.  You can easily install it with Cygwin for Windows.

Code Block
languagenone
%$ patch -p1 < patch_file

The output will give you some hints of whether each "hunk" of the patch file succeeded or failed.  If they all succeed, then likely the only thing wrong with the patch file is that a few context lines were changed.  If any hunks fail, patch creates files ending with ".rej" containing rejected hunks that it did not apply, and you can focus on those as places where the source code likely changed more significantly.  A command like this will find them all:

Code Block
languagenone
%$ find . -name '*.rej'

You will need to look at those rejected hunks, perhaps think about them for a bit to see if and how they still apply, and apply them by hand-editing the source code yourself.

When recreating a new git format patch with:

Code Block
languagenone
%$ git format-patch master --stdout > patch_file

...

If you are a screener testing a patch, you can create a new branch and apply the patch to start working with it:

Code Block
$ git checkout -b testxyz
$ git am --keep-cr -s --ignore-whitespace < patch_file

And you can throw that branch away when you're done with:

Code Block
$ git checkout master
$ git branch -D testxyz 

How To Run All Clojure Tests

...